...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 as_map
.
template <typename Sequence> struct as_map;
Parameter |
Requirement |
Description |
---|---|---|
|
A fusion Sequence |
The sequence to convert. |
result_of::as_map<Sequence>::type;
Return type: A map
with same elements as the
input sequence, Sequence
.
Semantics: Convert a fusion sequence,
Sequence
, to a map
.
Precondition: For non-associative sequence,
the elements are assumed to be __fusion_pair__s. There may be no duplicate
fusion::pair
key types.
#include <boost/fusion/container/map/convert.hpp> #include <boost/fusion/include/as_map.hpp>
// from sequence of __fusion_pair__ result_of::as_map<vector
<fusion::pair
<int, char> ,fusion::pair
<double, std::string> > >::type // from associative sequence namespace ns { struct x_member; struct y_member; } BOOST_FUSION_DEFINE_ASSOC_STRUCT( (ns), point, (int, x, ns::x_member) (int, y, ns::y_member) ) ... result_of::as_map<ns::point>::type // __map__<__fusion_pair__<ns::x_member, int>, __fusion_pair__<ns::y_member, int> >