1 // (C) Copyright Gennadiy Rozental 2001.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 //!@brief few helpers for working with variadic macros
10 // ***************************************************************************
12 #ifndef BOOST_TEST_PP_VARIADIC_HPP_021515GER
13 #define BOOST_TEST_PP_VARIADIC_HPP_021515GER
16 #include <boost/preprocessor/control/iif.hpp>
17 #include <boost/preprocessor/comparison/equal.hpp>
18 #include <boost/preprocessor/variadic/size.hpp>
20 //____________________________________________________________________________//
22 #if BOOST_PP_VARIADICS
24 #if BOOST_PP_VARIADICS_MSVC
25 # define BOOST_TEST_INVOKE_VARIADIC( tool, ... ) BOOST_PP_CAT( tool (__VA_ARGS__), )
27 # define BOOST_TEST_INVOKE_VARIADIC( tool, ... ) tool (__VA_ARGS__)
30 //____________________________________________________________________________//
32 /// if sizeof(__VA_ARGS__) == N: F1(__VA_ARGS__)
33 /// else: F2(__VA_ARGS__)
34 #define BOOST_TEST_INVOKE_IF_N_ARGS( N, F1, F2, ... ) \
35 BOOST_TEST_INVOKE_VARIADIC( \
37 BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), N), \
43 //____________________________________________________________________________//
45 #endif /* BOOST_PP_VARIADICS */
47 #endif // BOOST_TEST_PP_VARIADIC_HPP_021515GER