Files
externals/linux/include/ActivBoost/preprocessor/tuple/elem.hpp
T
2023-12-15 13:15:08 -05:00

56 lines
2.4 KiB
C++

# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002-2011) */
# /* Revised by Edward Diener (2011,2014,2020) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef ACTIV_BOOST_PREPROCESSOR_TUPLE_ELEM_HPP
# define ACTIV_BOOST_PREPROCESSOR_TUPLE_ELEM_HPP
#
# include <ActivBoost/preprocessor/cat.hpp>
# include <ActivBoost/preprocessor/config/config.hpp>
# include <ActivBoost/preprocessor/facilities/expand.hpp>
# include <ActivBoost/preprocessor/facilities/overload.hpp>
# include <ActivBoost/preprocessor/tuple/rem.hpp>
# include <ActivBoost/preprocessor/variadic/elem.hpp>
# include <ActivBoost/preprocessor/tuple/detail/is_single_return.hpp>
#
# if ACTIV_BOOST_PP_VARIADICS_MSVC
# define ACTIV_BOOST_PP_TUPLE_ELEM(...) ACTIV_BOOST_PP_TUPLE_ELEM_I(ACTIV_BOOST_PP_OVERLOAD(ACTIV_BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__), (__VA_ARGS__))
# define ACTIV_BOOST_PP_TUPLE_ELEM_I(m, args) ACTIV_BOOST_PP_TUPLE_ELEM_II(m, args)
# define ACTIV_BOOST_PP_TUPLE_ELEM_II(m, args) ACTIV_BOOST_PP_CAT(m ## args,)
/*
Use ACTIV_BOOST_PP_REM_CAT if it is a single element tuple ( which might be empty )
else use ACTIV_BOOST_PP_REM. This fixes a VC++ problem with an empty tuple and ACTIV_BOOST_PP_TUPLE_ELEM
functionality. See tuple_elem_bug_test.cxx.
*/
# define ACTIV_BOOST_PP_TUPLE_ELEM_O_2(n, tuple) \
ACTIV_BOOST_PP_VARIADIC_ELEM(n, ACTIV_BOOST_PP_EXPAND(ACTIV_BOOST_PP_TUPLE_IS_SINGLE_RETURN(ACTIV_BOOST_PP_REM_CAT,ACTIV_BOOST_PP_REM,tuple) tuple)) \
/**/
# else
# define ACTIV_BOOST_PP_TUPLE_ELEM(...) ACTIV_BOOST_PP_OVERLOAD(ACTIV_BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__)(__VA_ARGS__)
# define ACTIV_BOOST_PP_TUPLE_ELEM_O_2(n, tuple) ACTIV_BOOST_PP_VARIADIC_ELEM(n, ACTIV_BOOST_PP_REM tuple)
# endif
# define ACTIV_BOOST_PP_TUPLE_ELEM_O_3(size, n, tuple) ACTIV_BOOST_PP_TUPLE_ELEM_O_2(n, tuple)
#
# /* directly used elsewhere in Boost... */
#
# define ACTIV_BOOST_PP_TUPLE_ELEM_1_0(a) a
#
# define ACTIV_BOOST_PP_TUPLE_ELEM_2_0(a, b) a
# define ACTIV_BOOST_PP_TUPLE_ELEM_2_1(a, b) b
#
# define ACTIV_BOOST_PP_TUPLE_ELEM_3_0(a, b, c) a
# define ACTIV_BOOST_PP_TUPLE_ELEM_3_1(a, b, c) b
# define ACTIV_BOOST_PP_TUPLE_ELEM_3_2(a, b, c) c
#
# endif