Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:09:49

0001 //  (C) Copyright Gennadiy Rozental 2001.
0002 //  Distributed under the Boost Software License, Version 1.0.
0003 //  (See accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 //  See http://www.boost.org/libs/test for the library home page.
0007 //
0008 //!@file
0009 //!@brief few helpers for working with variadic macros
0010 // ***************************************************************************
0011 
0012 #ifndef BOOST_TEST_PP_VARIADIC_HPP_021515GER
0013 #define BOOST_TEST_PP_VARIADIC_HPP_021515GER
0014 
0015 // Boost
0016 #include <boost/preprocessor/control/iif.hpp>
0017 #include <boost/preprocessor/comparison/equal.hpp>
0018 #include <boost/preprocessor/variadic/size.hpp>
0019 
0020 //____________________________________________________________________________//
0021 
0022 #if BOOST_PP_VARIADICS
0023 
0024 #if BOOST_PP_VARIADICS_MSVC
0025 #  define BOOST_TEST_INVOKE_VARIADIC( tool, ... ) BOOST_PP_CAT( tool (__VA_ARGS__), )
0026 #else
0027 #  define BOOST_TEST_INVOKE_VARIADIC( tool, ... ) tool (__VA_ARGS__)
0028 #endif
0029 
0030 //____________________________________________________________________________//
0031 
0032 /// if sizeof(__VA_ARGS__) == N: F1(__VA_ARGS__)
0033 /// else:                        F2(__VA_ARGS__)
0034 #define BOOST_TEST_INVOKE_IF_N_ARGS( N, F1, F2, ... )               \
0035     BOOST_TEST_INVOKE_VARIADIC(                                     \
0036         BOOST_PP_IIF(                                               \
0037             BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), N), \
0038             F1,                                                     \
0039             F2),                                                    \
0040         __VA_ARGS__ )                                               \
0041 /**/
0042 
0043 //____________________________________________________________________________//
0044 
0045 #endif  /* BOOST_PP_VARIADICS */
0046 
0047 #endif // BOOST_TEST_PP_VARIADIC_HPP_021515GER
0048 
0049 // EOF