2007-10-21 00:52:09 +00:00
|
|
|
/*=============================================================================
|
2013-02-04 03:49:34 +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>
|
|
|
|
|
2013-02-04 03:49:34 +00:00
|
|
|
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
|
|
|
|
# include <boost/fusion/container/generation/detail/pp_make_map.hpp>
|
2011-09-17 05:52:59 +00:00
|
|
|
#else
|
|
|
|
|
2013-02-04 03:49:34 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// C++11 variadic interface
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
|
|
|
#include <boost/fusion/support/pair.hpp>
|
2011-09-17 05:52:59 +00:00
|
|
|
|
2007-10-21 00:52:09 +00:00
|
|
|
namespace boost { namespace fusion
|
|
|
|
{
|
|
|
|
namespace result_of
|
|
|
|
{
|
2013-02-04 03:49:34 +00:00
|
|
|
template <typename ...Key>
|
|
|
|
struct make_map
|
2007-10-21 00:52:09 +00:00
|
|
|
{
|
2013-02-04 03:49:34 +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
|
|
|
|
2013-02-04 03:49:34 +00:00
|
|
|
template <typename ...Key, typename ...T>
|
2014-01-09 17:58:06 -08:00
|
|
|
BOOST_FUSION_GPU_ENABLED
|
2013-02-04 03:49:34 +00:00
|
|
|
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
|
|
|
{
|
2013-02-04 03:49:34 +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
|
|
|
}
|
2013-02-04 03:49:34 +00:00
|
|
|
}}
|
2007-10-21 00:52:09 +00:00
|
|
|
|
2007-11-05 02:10:42 +00:00
|
|
|
#endif
|
2014-01-21 14:17:09 -08:00
|
|
|
#endif
|