Boost C++ Libraries: Ticket #6965: Handling of sequence of non const reference https://svn.boost.org/trac10/ticket/6965 <p> Currently, assigning or copying a fusion sequence of non const reference to another is not possible. Down into the code, the vectorN classes only has a vectorN( const Sequence&amp; ) constructor that calls a const qualified from_sequence method from the base_type. </p> <p> Sequence of reference has a nice use case of enabling strcuture of array<em>Array of structure efficient application and this can't be doen with current Fusion. </em></p> <p> Could all sequence be amended so passing a non const sequence as initialisation is dealt with correctly ? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6965 Trac 1.4.3 Joel de Guzman Thu, 07 Jun 2012 00:46:36 GMT <link>https://svn.boost.org/trac10/ticket/6965#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6965#comment:1</guid> <description> <p> If you can provide a test case for a specific use case, I can look into this and implement a fusion wide mod. Thanks, Joel! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel Falcou</dc:creator> <pubDate>Thu, 07 Jun 2012 05:36:15 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/6965 https://svn.boost.org/trac10/ticket/6965 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ref_vector.cpp</span> </li> </ul> <p> Test case for composite_reference, a class acting as a reference tuple onto an struct adapted as a fusion sequence </p> Ticket Joel Falcou Thu, 07 Jun 2012 05:37:08 GMT attachment set https://svn.boost.org/trac10/ticket/6965 https://svn.boost.org/trac10/ticket/6965 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ref_vector.error.output</span> </li> </ul> <p> Error of former example </p> Ticket Joel Falcou Thu, 07 Jun 2012 05:38:54 GMT <link>https://svn.boost.org/trac10/ticket/6965#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6965#comment:2</guid> <description> <p> I Just attached a test case and the error I get. Adding: </p> <pre class="wiki"> template &lt;typename Sequence&gt; static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence&amp; seq) { typedef typename result_of::begin&lt;Sequence&gt;::type I0; I0 i0 = fusion::begin(seq); BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); } template &lt;typename Sequence&gt; BOOST_PP_CAT(vector, N)( Sequence&amp; seq #if (N == 1) , typename boost::disable_if&lt;is_convertible&lt;Sequence, T0&gt; &gt;::type* /*dummy*/ = 0 #endif ) : base_type(base_type::init_from_sequence(seq)) {} </pre><p> to vector_n.hpp and re-preprocess fix the stuff. I guess other sequences may have similar mechanism. Not sure about any side effect tough. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Tue, 26 Jun 2012 10:19:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6965#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6965#comment:3</guid> <description> <p> Fixed for vector. I'll leave this open as a reminder to fix other containers. </p> </description> <category>Ticket</category> </item> </channel> </rss>