...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns the result type of make_map
.
The implementation depends on the support of variadic templates.
When variadic templates are not supported, make_map is a metafunction of the form:
template < typename K0, typename K1,... typename KN , typename T0, typename T1,... typename TN> struct make_map;
For C++11 compilers, the variadic function interface has no upper bound.
For C++03 compilers, the variadic function accepts 0
to FUSION_MAX_MAP_SIZE
elements, where FUSION_MAX_MAP_SIZE
is a user definable predefined maximum that defaults to 10
. You may define the preprocessor constant
FUSION_MAX_MAP_SIZE
before
including any Fusion header to change the default. Example:
#define FUSION_MAX_MAP_SIZE 20
When variadic templates are supported, make_map is a metafunction class of the form:
template < typename K0, typename K1,... typename KN> struct make_map { struct apply< typename T0, typename T1,... typename TN> };
Parameter |
Requirement |
Description |
---|---|---|
|
Any type |
Keys associated with |
|
Any type |
Data associated with keys |
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP) resulf_of::make_map<K0, K1,... KN, T0, T1,... TN>::type; #else resulf_of::make_map<K0, K1,... KN>::apply<T0, T1,... TN>::type; #endif
Return type: result_of::make_map
<K0, K0,... KN, T0, T1,... TN>::type
when variadic templates are not
supported, or result_of::make_map
<K0, K0,... KN>::apply<T0, T1,... TN>::type
when variadic templates are supported.
Semantics: A map
with fusion::pair
elements where the second_type
is converted following
the rules for element
conversion.
Precondition: There may be no duplicate key types.
#include <boost/fusion/container/generation/make_map.hpp> #include <boost/fusion/include/make_map.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_MAP) result_of::make_map<int, double, char, double>::type #else result_of::make_map<int, double>::apply<char, double>::type #endif