From d1973805409a841c6fd109a5d6f887263044fb50 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Thu, 18 Jun 2015 08:31:07 +0900 Subject: [PATCH] Implement C++11 list_tie. --- .../generation/detail/pp_list_tie.hpp | 2 +- .../fusion/container/generation/list_tie.hpp | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/container/generation/detail/pp_list_tie.hpp b/include/boost/fusion/container/generation/detail/pp_list_tie.hpp index 561677f9..be25627a 100644 --- a/include/boost/fusion/container/generation/detail/pp_list_tie.hpp +++ b/include/boost/fusion/container/generation/detail/pp_list_tie.hpp @@ -53,7 +53,7 @@ namespace boost { namespace fusion // $$$ shouldn't we remove_reference first to allow references? $$$ #define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)& -#define BOOST_PP_FILENAME_1 +#define BOOST_PP_FILENAME_1 #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE) #include BOOST_PP_ITERATE() diff --git a/include/boost/fusion/container/generation/list_tie.hpp b/include/boost/fusion/container/generation/list_tie.hpp index afc0ab2f..91907167 100644 --- a/include/boost/fusion/container/generation/list_tie.hpp +++ b/include/boost/fusion/container/generation/list_tie.hpp @@ -10,7 +10,35 @@ #include #include +#if !defined(BOOST_FUSION_HAS_VARIADIC_LIST) # include +#else + +/////////////////////////////////////////////////////////////////////////////// +// C++11 variadic interface +/////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct list_tie + { + typedef list type; + }; + } + + template + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline list + list_tie(T&... arg) + { + return list(arg...); + } +}} + +#endif #endif