Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1404: Unordered Fusion Map constructors.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-28 17:48:35
#1404: Unordered Fusion Map constructors.
-----------------------------------------------------------+----------------
Reporter: Dean Michael Berris <mikhailberis_at_[hidden]> | Owner: djowel
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: fusion
Version: Boost Development Trunk | Severity: Cosmetic
Resolution: | Keywords:
-----------------------------------------------------------+----------------
Comment(by srajko):
[Bug Sprint] One way I see of implementing this would be through a view
which reorders the elements of a source map to match the order of keys of
a target map. This view could then be used for construction and
assignment from an existing map:
{{{
my_map_type instance (
reorder_map_to<my_map_type> (
make_map( make_pair<tags::type_2>(2), make_pair<tags::type_1>(1) ) )
);
instance =
reorder_map_to<my_map_type> (
make_map( make_pair<tags::type_2>(2), make_pair<tags::type_1>(1) ) )
);
// or
my_map_type instance ( reorder_map_to<my_map_type> (some_other_map) );
instance = reorder_map_to<my_map_type> (some_other_map);
}}}
The map class could use the reordering view automatically in construction
from a list of arguments, construction from a Sequence, and assignment (so
that the OP's original code snippet compiles), but that would complicate
the otherwise simple implementation. Would using the reordering view
manually fulfill the need here?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/1404#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC