mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-13 20:46:34 +02:00
Added BOOST_PP_EXPAND()
[SVN r12362]
This commit is contained in:
24
include/boost/preprocessor/expand.hpp
Normal file
24
include/boost/preprocessor/expand.hpp
Normal 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
|
@ -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
|
||||||
|
Reference in New Issue
Block a user