...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Constructs a tie using a map
sequence.
template <typename K0, typename K1,... typename KN, typename D0, typename D1,... typename DN>map
<pair
<K0, D0&>,pair
<K1, D1&>,...pair
<KN, DN&> > map_tie(D0& d0, D1& d1... DN& dN);
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
, and a corresponding number of key types.
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
Parameter |
Requirement |
Description |
---|---|---|
|
Any type |
The key types associated with each of the |
|
Instances of |
The arguments to |
map_tie<K0, K1,... KN>(x0, x1,... xN);
Return type: map
<pair
<K0, D0&>, pair
<K1,
D1&>,... pair
<KN,
DN&> >
Semantics: Create a map
of references from x0, x1,... xN
with keys K0, K1,... KN
#include <boost/fusion/container/generation/map_tie.hpp> #include <boost/fusion/include/map_tie.hpp>
struct int_key; struct double_key; ... int i = 123; double d = 123.456; map_tie<int_key, double_key>(i, d)