Boost C++ Libraries: Ticket #1404: Unordered Fusion Map constructors. https://svn.boost.org/trac10/ticket/1404 <p> Currenty, when constructing Fusion Maps, the order of type arguments used as template parameters need to be followed in the constructor as well. </p> <p> Example: </p> <pre class="wiki"> struct tags { struct type_1 { }; struct type_2 { }; }; using namespace boost::fusion ; typedef map&lt; pair&lt;tags::type_1, int&gt;, pair&lt;tags::type_2, int&gt; &gt; my_map_type ; { // following line will not compile, because of the argument ordering my_map_type instance( make_pair&lt;tags::type_2&gt;(2), make_pair&lt;tags::type_1&gt;(1) ); // following line will compile, because the argument order is the same as // the order of elements in the fusion map specialization my_map_type instace_works( make_pair&lt;tags::type_1&gt;(1), make_pair&lt;tags::type_2&gt;(2) ); } </pre><p> The feature request is to support arbitrary ordering of constructor arguments, not necessarily to follow the order of argument types as prescribed in the template arguments to the fusion map. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1404 Trac 1.4.3 Stjepan Rajko Thu, 28 May 2009 17:48:33 GMT <link>https://svn.boost.org/trac10/ticket/1404#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1404#comment:1</guid> <description> <p> [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: </p> <pre class="wiki"> my_map_type instance ( reorder_map_to&lt;my_map_type&gt; ( make_map( make_pair&lt;tags::type_2&gt;(2), make_pair&lt;tags::type_1&gt;(1) ) ) ); instance = reorder_map_to&lt;my_map_type&gt; ( make_map( make_pair&lt;tags::type_2&gt;(2), make_pair&lt;tags::type_1&gt;(1) ) ) ); // or my_map_type instance ( reorder_map_to&lt;my_map_type&gt; (some_other_map) ); instance = reorder_map_to&lt;my_map_type&gt; (some_other_map); </pre><p> 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? </p> </description> <category>Ticket</category> </item> </channel> </rss>