1# /* **************************************************************************
2#  *                                                                          *
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)                                *
8#  *                                                                          *
9#  ************************************************************************** */
10#
11# /* See http://www.boost.org for most recent version. */
12#
13# ifndef MSGPACK_PREPROCESSOR_TUPLE_TO_ARRAY_HPP
14# define MSGPACK_PREPROCESSOR_TUPLE_TO_ARRAY_HPP
15#
16# include <msgpack/preprocessor/cat.hpp>
17# include <msgpack/preprocessor/config/config.hpp>
18# include <msgpack/preprocessor/facilities/overload.hpp>
19# include <msgpack/preprocessor/tuple/size.hpp>
20# include <msgpack/preprocessor/variadic/size.hpp>
21#
22# /* MSGPACK_PP_TUPLE_TO_ARRAY */
23#
24# if MSGPACK_PP_VARIADICS
25#    if MSGPACK_PP_VARIADICS_MSVC
26#        define MSGPACK_PP_TUPLE_TO_ARRAY(...) MSGPACK_PP_TUPLE_TO_ARRAY_I(MSGPACK_PP_OVERLOAD(MSGPACK_PP_TUPLE_TO_ARRAY_, __VA_ARGS__), (__VA_ARGS__))
27#        define MSGPACK_PP_TUPLE_TO_ARRAY_I(m, args) MSGPACK_PP_TUPLE_TO_ARRAY_II(m, args)
28#        define MSGPACK_PP_TUPLE_TO_ARRAY_II(m, args) MSGPACK_PP_CAT(m ## args,)
29#        define MSGPACK_PP_TUPLE_TO_ARRAY_1(tuple) (MSGPACK_PP_TUPLE_SIZE(tuple), tuple)
30#    else
31#        define MSGPACK_PP_TUPLE_TO_ARRAY(...) MSGPACK_PP_OVERLOAD(MSGPACK_PP_TUPLE_TO_ARRAY_, __VA_ARGS__)(__VA_ARGS__)
32#        define MSGPACK_PP_TUPLE_TO_ARRAY_1(tuple) (MSGPACK_PP_VARIADIC_SIZE tuple, tuple)
33#    endif
34#    define MSGPACK_PP_TUPLE_TO_ARRAY_2(size, tuple) (size, tuple)
35# else
36#    define MSGPACK_PP_TUPLE_TO_ARRAY(size, tuple) (size, tuple)
37# endif
38#
39# endif
40