1 # /* **************************************************************************
3 # * (C) Copyright Edward Diener 2011. *
4 # * (C) Copyright Paul Mensonides 2011. *
5 # * Distributed under the Boost Software License, Version 1.0. (See *
6 # * accompanying file LICENSE_1_0.txt or copy at *
7 # * http://www.boost.org/LICENSE_1_0.txt) *
9 # ************************************************************************** */
11 # /* See http://www.boost.org for most recent version. */
13 # ifndef BOOST_PREPROCESSOR_TUPLE_SIZE_HPP
14 # define BOOST_PREPROCESSOR_TUPLE_SIZE_HPP
16 # include <boost/preprocessor/cat.hpp>
17 # include <boost/preprocessor/config/config.hpp>
18 # include <boost/preprocessor/control/if.hpp>
19 # include <boost/preprocessor/variadic/has_opt.hpp>
20 # include <boost/preprocessor/variadic/size.hpp>
22 # if BOOST_PP_VARIADIC_HAS_OPT()
23 # if BOOST_PP_VARIADICS_MSVC
24 # define BOOST_PP_TUPLE_SIZE(tuple) BOOST_PP_TUPLE_SIZE_CHECK(BOOST_PP_CAT(BOOST_PP_VARIADIC_SIZE tuple,))
26 # define BOOST_PP_TUPLE_SIZE(tuple) BOOST_PP_TUPLE_SIZE_CHECK(BOOST_PP_VARIADIC_SIZE tuple)
28 # define BOOST_PP_TUPLE_SIZE_CHECK(size) BOOST_PP_IF(size,size,1)
29 # elif BOOST_PP_VARIADICS_MSVC
30 # define BOOST_PP_TUPLE_SIZE(tuple) BOOST_PP_CAT(BOOST_PP_VARIADIC_SIZE tuple,)
32 # define BOOST_PP_TUPLE_SIZE(tuple) BOOST_PP_VARIADIC_SIZE tuple