Added BOOST_PP_EXPAND()

[SVN r12362]
This commit is contained in:
Vesa Karvonen
2002-01-19 20:14:32 +00:00
parent 609357592a
commit 03e35a4408
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,24 @@
#ifndef BOOST_PREPROCESSOR_EXPAND_HPP
#define BOOST_PREPROCESSOR_EXPAND_HPP
// Copyright (C) 2001
// Housemarque Oy
// 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/expand.hpp">Click here to see the header.</a>
*/
#include <boost/preprocessor/identity.hpp>
//! Essentially macro expands the parameter X twice.
#define BOOST_PP_EXPAND(X) X
#endif

View File

@ -17,7 +17,7 @@
<a href="../../../../boost/preprocessor/tuple/elem.hpp">Click here to see the header.</a> <a href="../../../../boost/preprocessor/tuple/elem.hpp">Click here to see the header.</a>
*/ */
#include <boost/preprocessor/identity.hpp> #include <boost/preprocessor/expand.hpp>
//! Expands to the I:th element of an N-tuple. //! Expands to the I:th element of an N-tuple.
/*! /*!
@ -49,7 +49,7 @@ See also BOOST_PP_LIMIT_TUPLE.
// this workaround invokes undefined behavior, but it works as desired. // this workaround invokes undefined behavior, but it works as desired.
# define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_TUPLE##N##_ELEM##I##T # define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_TUPLE##N##_ELEM##I##T
#else #else
# define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_IDENTITY(BOOST_PP_TUPLE##N##_ELEM##I T)() # define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_EXPAND(BOOST_PP_TUPLE##N##_ELEM##I T)
#endif #endif
// NOTE: TUPLE_ELEM can be implemented in O(N*N) space and O(N) time instead // NOTE: TUPLE_ELEM can be implemented in O(N*N) space and O(N) time instead