diff --git a/include/boost/preprocessor/expand.hpp b/include/boost/preprocessor/expand.hpp new file mode 100644 index 0000000..6565d00 --- /dev/null +++ b/include/boost/preprocessor/expand.hpp @@ -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 + +Click here to see the header. +*/ + +#include + +//! Essentially macro expands the parameter X twice. +#define BOOST_PP_EXPAND(X) X +#endif diff --git a/include/boost/preprocessor/tuple/elem.hpp b/include/boost/preprocessor/tuple/elem.hpp index 2691895..862b28c 100644 --- a/include/boost/preprocessor/tuple/elem.hpp +++ b/include/boost/preprocessor/tuple/elem.hpp @@ -17,7 +17,7 @@ Click here to see the header. */ -#include +#include //! 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. # define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_TUPLE##N##_ELEM##I##T #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 // NOTE: TUPLE_ELEM can be implemented in O(N*N) space and O(N) time instead