Implement C++11 list_tie.

This commit is contained in:
Kohei Takahashi
2015-06-18 08:31:07 +09:00
parent 3d0412bfd1
commit d197380540
2 changed files with 29 additions and 1 deletions

View File

@ -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 <boost/fusion/container/generation/detail/list_tie.hpp>
#define BOOST_PP_FILENAME_1 <boost/fusion/container/generation/detail/pp_list_tie.hpp>
#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE)
#include BOOST_PP_ITERATE()

View File

@ -10,7 +10,35 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/list/list.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_LIST)
# include <boost/fusion/container/generation/detail/pp_list_tie.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 variadic interface
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion
{
namespace result_of
{
template <typename ...T>
struct list_tie
{
typedef list<T&...> type;
};
}
template <typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline list<T&...>
list_tie(T&... arg)
{
return list<T&...>(arg...);
}
}}
#endif
#endif