#ifndef BOOST_PREPROCESSOR_TUPLE_HPP
#define BOOST_PREPROCESSOR_TUPLE_HPP

//  Copyright (C) 2001
//  Housemarque, Inc.
//  http://www.housemarque.com
//  
//  Permission to copy, use, modify, sell and distribute this software is
//  granted provided this copyright notice appears in all copies. This
//  software is provided "as is" without express or implied warranty, and
//  with no claim as to its suitability for any purpose.

//  See http://www.boost.org for most recent version.

/*! \file

<a href="../../../../boost/preprocessor/tuple.hpp">Click here to see the header.</a>
*/

#ifndef BOOST_PREPROCESSOR_IDENTITY_HPP
#  include <boost/preprocessor/identity.hpp>
#endif

//! Expands to the I:th element of an N-tuple.
/*!
Examples of tuples:

<PRE>\verbatim
  2-tuple: (A, B)
  3-tuple: (1, 2, 3)
  4-tuple: (A B C, D, EF, 34)
\endverbatim</PRE>

Example:

<PRE>\verbatim
  BOOST_PREPROCESSOR_TUPLE_ELEM(2,1,(A,B))
\endverbatim</PRE>

The above expands to:

<PRE>\verbatim
  B
\endverbatim</PRE>
*/
#define BOOST_PREPROCESSOR_TUPLE_ELEM(N,I,T) BOOST_PREPROCESSOR_TUPLE_ELEM_DELAY(N,I,T)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOOST_PREPROCESSOR_TUPLE_ELEM_DELAY(N,I,T) BOOST_PREPROCESSOR_IDENTITY(BOOST_PREPROCESSOR_TUPLE##N##_ELEM##I T)()

#define BOOST_PREPROCESSOR_TUPLE1_ELEM0(E0) E0

#define BOOST_PREPROCESSOR_TUPLE2_ELEM0(E0,E1) E0
#define BOOST_PREPROCESSOR_TUPLE2_ELEM1(E0,E1) E1

#define BOOST_PREPROCESSOR_TUPLE3_ELEM0(E0,E1,E2) E0
#define BOOST_PREPROCESSOR_TUPLE3_ELEM1(E0,E1,E2) E1
#define BOOST_PREPROCESSOR_TUPLE3_ELEM2(E0,E1,E2) E2

#define BOOST_PREPROCESSOR_TUPLE4_ELEM0(E0,E1,E2,E3) E0
#define BOOST_PREPROCESSOR_TUPLE4_ELEM1(E0,E1,E2,E3) E1
#define BOOST_PREPROCESSOR_TUPLE4_ELEM2(E0,E1,E2,E3) E2
#define BOOST_PREPROCESSOR_TUPLE4_ELEM3(E0,E1,E2,E3) E3

#define BOOST_PREPROCESSOR_TUPLE5_ELEM0(E0,E1,E2,E3,E4) E0
#define BOOST_PREPROCESSOR_TUPLE5_ELEM1(E0,E1,E2,E3,E4) E1
#define BOOST_PREPROCESSOR_TUPLE5_ELEM2(E0,E1,E2,E3,E4) E2
#define BOOST_PREPROCESSOR_TUPLE5_ELEM3(E0,E1,E2,E3,E4) E3
#define BOOST_PREPROCESSOR_TUPLE5_ELEM4(E0,E1,E2,E3,E4) E4

#define BOOST_PREPROCESSOR_TUPLE6_ELEM0(E0,E1,E2,E3,E4,E5) E0
#define BOOST_PREPROCESSOR_TUPLE6_ELEM1(E0,E1,E2,E3,E4,E5) E1
#define BOOST_PREPROCESSOR_TUPLE6_ELEM2(E0,E1,E2,E3,E4,E5) E2
#define BOOST_PREPROCESSOR_TUPLE6_ELEM3(E0,E1,E2,E3,E4,E5) E3
#define BOOST_PREPROCESSOR_TUPLE6_ELEM4(E0,E1,E2,E3,E4,E5) E4
#define BOOST_PREPROCESSOR_TUPLE6_ELEM5(E0,E1,E2,E3,E4,E5) E5

#define BOOST_PREPROCESSOR_TUPLE7_ELEM0(E0,E1,E2,E3,E4,E5,E6) E0
#define BOOST_PREPROCESSOR_TUPLE7_ELEM1(E0,E1,E2,E3,E4,E5,E6) E1
#define BOOST_PREPROCESSOR_TUPLE7_ELEM2(E0,E1,E2,E3,E4,E5,E6) E2
#define BOOST_PREPROCESSOR_TUPLE7_ELEM3(E0,E1,E2,E3,E4,E5,E6) E3
#define BOOST_PREPROCESSOR_TUPLE7_ELEM4(E0,E1,E2,E3,E4,E5,E6) E4
#define BOOST_PREPROCESSOR_TUPLE7_ELEM5(E0,E1,E2,E3,E4,E5,E6) E5
#define BOOST_PREPROCESSOR_TUPLE7_ELEM6(E0,E1,E2,E3,E4,E5,E6) E6

#define BOOST_PREPROCESSOR_TUPLE8_ELEM0(E0,E1,E2,E3,E4,E5,E6,E7) E0
#define BOOST_PREPROCESSOR_TUPLE8_ELEM1(E0,E1,E2,E3,E4,E5,E6,E7) E1
#define BOOST_PREPROCESSOR_TUPLE8_ELEM2(E0,E1,E2,E3,E4,E5,E6,E7) E2
#define BOOST_PREPROCESSOR_TUPLE8_ELEM3(E0,E1,E2,E3,E4,E5,E6,E7) E3
#define BOOST_PREPROCESSOR_TUPLE8_ELEM4(E0,E1,E2,E3,E4,E5,E6,E7) E4
#define BOOST_PREPROCESSOR_TUPLE8_ELEM5(E0,E1,E2,E3,E4,E5,E6,E7) E5
#define BOOST_PREPROCESSOR_TUPLE8_ELEM6(E0,E1,E2,E3,E4,E5,E6,E7) E6
#define BOOST_PREPROCESSOR_TUPLE8_ELEM7(E0,E1,E2,E3,E4,E5,E6,E7) E7
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#endif
