Files
boost_fusion/include/boost/fusion/container/generation/make_map.hpp
T

65 lines
1.8 KiB
C++
Raw Normal View History

2007-10-21 00:52:09 +00:00
/*=============================================================================
Copyright (c) 2001-2013 Joel de Guzman
2007-10-21 00:52:09 +00:00
2011-09-17 05:52:59 +00:00
Distributed under the Boost Software License, Version 1.0. (See accompanying
2007-10-21 00:52:09 +00:00
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_MAKE_MAP_07222005_1247)
#define FUSION_MAKE_MAP_07222005_1247
2014-01-09 17:58:06 -08:00
#include <boost/fusion/support/config.hpp>
2007-10-21 00:52:09 +00:00
#include <boost/fusion/container/map/map.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
# include <boost/fusion/container/generation/detail/pp_make_map.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 variadic interface
///////////////////////////////////////////////////////////////////////////////
2007-10-21 00:52:09 +00:00
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/fusion/support/pair.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename ...Key>
struct make_map
2007-10-21 00:52:09 +00:00
{
template <typename ...T>
struct apply
{
typedef map<
fusion::pair<
Key
, typename detail::as_fusion_element<T>::type
>...>
type;
};
2007-10-21 00:52:09 +00:00
};
}
2011-09-17 05:52:59 +00:00
template <typename ...Key, typename ...T>
2015-03-03 02:21:02 +09:00
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline map<
fusion::pair<
Key
, typename detail::as_fusion_element<T>::type
>...>
make_map(T const&... arg)
2007-10-21 00:52:09 +00:00
{
typedef map<
fusion::pair<
Key
, typename detail::as_fusion_element<T>::type
>...>
result_type;
return result_type(arg...);
2007-10-21 00:52:09 +00:00
}
}}
2011-09-17 05:52:59 +00:00
2007-10-21 00:52:09 +00:00
#endif
#endif