| Home | Libraries | People | FAQ | More

##### make_map

###### Description

Create a `map` from one or more key/data pairs.

###### Synopsis

    template <
        typename K0, typename K1,... typename KN
      , typename T0, typename T1,... typename TN>
    typename result_of::make_map<K0, K0,... KN, T0, T1,... TN>::type
    make_map(T0 const& x0, T1 const& x1... TN const& xN);

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

###### Parameters

Parameter | Requirement | Description
--- | --- | ---
`K0, K1,... KN` | The key types | Keys associated with `x0, x1,... xN`
`x0, x1,... xN` | Instances of `T0, T1,... TN` | The arguments to `make_map`

###### Expression Semantics

    make_map<K0, K1,... KN>(x0, x1,... xN);

Return type: `result_of::make_map``<K0, K0,... KN, T0, T1,... TN>::type`

Semantics: Create a `map` from `K0, K1,... KN` keys and `x0, x1,... xN` data.

Precondition: There may be no duplicate key types.

###### Header

    #include <boost/fusion/container/generation/make_map.hpp>
    #include <boost/fusion/include/make_map.hpp>

###### Example

    make_map<int, double>('X', "Men")

###### See also

`boost::ref`, `fusion::pair`