mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-01 06:50:59 +02:00
PREPROCESSOR -> PP. WHILE documented.
[SVN r12162]
This commit is contained in:
@ -17,12 +17,12 @@
|
||||
<a href="../../../../boost/preprocessor/tuple.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#ifndef BOOST_PREPROCESSOR_IDENTITY_HPP
|
||||
# include <boost/preprocessor/identity.hpp>
|
||||
#endif
|
||||
#include <boost/preprocessor/identity.hpp>
|
||||
|
||||
//! Expands to the I:th element of an N-tuple.
|
||||
/*!
|
||||
Tuples can be used for representing structured data.
|
||||
|
||||
Examples of tuples:
|
||||
|
||||
<PRE>\verbatim
|
||||
@ -34,7 +34,7 @@ Examples of tuples:
|
||||
Example:
|
||||
|
||||
<PRE>\verbatim
|
||||
BOOST_PREPROCESSOR_TUPLE_ELEM(2,1,(A,B))
|
||||
BOOST_PP_TUPLE_ELEM(2,1,(A,B))
|
||||
\endverbatim</PRE>
|
||||
|
||||
The above expands to:
|
||||
@ -42,60 +42,68 @@ The above expands to:
|
||||
<PRE>\verbatim
|
||||
B
|
||||
\endverbatim</PRE>
|
||||
|
||||
See also BOOST_PP_LIMIT_TUPLE.
|
||||
*/
|
||||
#define BOOST_PREPROCESSOR_TUPLE_ELEM(N,I,T) BOOST_PREPROCESSOR_TUPLE_ELEM_DELAY(N,I,T)
|
||||
#define BOOST_PP_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM_DELAY(N,I,T)
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
#if defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
// This is a workaround for a CodeWarrior preprocessor bug. Strictly speaking
|
||||
// This is a workaround for a CodeWarrior PP bug. Strictly speaking
|
||||
// this workaround invokes undefined behavior, but it works as desired.
|
||||
# define BOOST_PREPROCESSOR_TUPLE_ELEM_DELAY(N,I,T) BOOST_PREPROCESSOR_TUPLE##N##_ELEM##I##T
|
||||
# define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_TUPLE##N##_ELEM##I##T
|
||||
#else
|
||||
# define BOOST_PREPROCESSOR_TUPLE_ELEM_DELAY(N,I,T) BOOST_PREPROCESSOR_IDENTITY(BOOST_PREPROCESSOR_TUPLE##N##_ELEM##I T)()
|
||||
# define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_IDENTITY(BOOST_PP_TUPLE##N##_ELEM##I T)()
|
||||
#endif
|
||||
|
||||
#define BOOST_PREPROCESSOR_TUPLE1_ELEM0(E0) E0
|
||||
// NOTE: TUPLE_ELEM can be implemented in O(N*N) space and O(N) time instead
|
||||
// of O(N*N*N) space and O(1) time. The current trade-off seems better.
|
||||
|
||||
#define BOOST_PREPROCESSOR_TUPLE2_ELEM0(E0,E1) E0
|
||||
#define BOOST_PREPROCESSOR_TUPLE2_ELEM1(E0,E1) E1
|
||||
#define BOOST_PP_TUPLE1_ELEM0(A) A
|
||||
|
||||
#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_PP_TUPLE2_ELEM0(A,B) A
|
||||
#define BOOST_PP_TUPLE2_ELEM1(A,B) B
|
||||
|
||||
#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_PP_TUPLE3_ELEM0(A,B,C) A
|
||||
#define BOOST_PP_TUPLE3_ELEM1(A,B,C) B
|
||||
#define BOOST_PP_TUPLE3_ELEM2(A,B,C) C
|
||||
|
||||
#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_PP_TUPLE4_ELEM0(A,B,C,D) A
|
||||
#define BOOST_PP_TUPLE4_ELEM1(A,B,C,D) B
|
||||
#define BOOST_PP_TUPLE4_ELEM2(A,B,C,D) C
|
||||
#define BOOST_PP_TUPLE4_ELEM3(A,B,C,D) D
|
||||
|
||||
#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_PP_TUPLE5_ELEM0(A,B,C,D,E) A
|
||||
#define BOOST_PP_TUPLE5_ELEM1(A,B,C,D,E) B
|
||||
#define BOOST_PP_TUPLE5_ELEM2(A,B,C,D,E) C
|
||||
#define BOOST_PP_TUPLE5_ELEM3(A,B,C,D,E) D
|
||||
#define BOOST_PP_TUPLE5_ELEM4(A,B,C,D,E) E
|
||||
|
||||
#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_PP_TUPLE6_ELEM0(A,B,C,D,E,F) A
|
||||
#define BOOST_PP_TUPLE6_ELEM1(A,B,C,D,E,F) B
|
||||
#define BOOST_PP_TUPLE6_ELEM2(A,B,C,D,E,F) C
|
||||
#define BOOST_PP_TUPLE6_ELEM3(A,B,C,D,E,F) D
|
||||
#define BOOST_PP_TUPLE6_ELEM4(A,B,C,D,E,F) E
|
||||
#define BOOST_PP_TUPLE6_ELEM5(A,B,C,D,E,F) F
|
||||
|
||||
#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 */
|
||||
#define BOOST_PP_TUPLE7_ELEM0(A,B,C,D,E,F,G) A
|
||||
#define BOOST_PP_TUPLE7_ELEM1(A,B,C,D,E,F,G) B
|
||||
#define BOOST_PP_TUPLE7_ELEM2(A,B,C,D,E,F,G) C
|
||||
#define BOOST_PP_TUPLE7_ELEM3(A,B,C,D,E,F,G) D
|
||||
#define BOOST_PP_TUPLE7_ELEM4(A,B,C,D,E,F,G) E
|
||||
#define BOOST_PP_TUPLE7_ELEM5(A,B,C,D,E,F,G) F
|
||||
#define BOOST_PP_TUPLE7_ELEM6(A,B,C,D,E,F,G) G
|
||||
|
||||
#define BOOST_PP_TUPLE8_ELEM0(A,B,C,D,E,F,G,H) A
|
||||
#define BOOST_PP_TUPLE8_ELEM1(A,B,C,D,E,F,G,H) B
|
||||
#define BOOST_PP_TUPLE8_ELEM2(A,B,C,D,E,F,G,H) C
|
||||
#define BOOST_PP_TUPLE8_ELEM3(A,B,C,D,E,F,G,H) D
|
||||
#define BOOST_PP_TUPLE8_ELEM4(A,B,C,D,E,F,G,H) E
|
||||
#define BOOST_PP_TUPLE8_ELEM5(A,B,C,D,E,F,G,H) F
|
||||
#define BOOST_PP_TUPLE8_ELEM6(A,B,C,D,E,F,G,H) G
|
||||
#define BOOST_PP_TUPLE8_ELEM7(A,B,C,D,E,F,G,H) H
|
||||
#endif
|
||||
|
||||
//! Obsolete. Use BOOST_PP_TUPLE_ELEM().
|
||||
#define BOOST_PREPROCESSOR_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM(N,I,T)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user