Boost C++ Libraries: Ticket #12344: boost::fusion::extension::struct_member_name doesn't work with a const sequence https://svn.boost.org/trac10/ticket/12344 <p> Here is the code to reproduce the bug: </p> <div class="wiki-code"><div class="code"><pre><span class="k">struct</span> <span class="n">Hello</span> <span class="p">{</span> <span class="kt">int</span> <span class="n">World</span><span class="p">;</span> <span class="p">};</span> <span class="n">BOOST_FUSION_ADAPT_STRUCT</span><span class="p">(</span><span class="n">Hello</span><span class="p">,</span> <span class="n">World</span><span class="p">);</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">using</span> <span class="n">Seq</span> <span class="o">=</span> <span class="k">const</span> <span class="n">Hello</span><span class="p">;</span> <span class="c1">// &lt;- works when const is removed</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">boost</span><span class="o">::</span><span class="n">fusion</span><span class="o">::</span><span class="n">extension</span><span class="o">::</span><span class="n">struct_member_name</span><span class="o">&lt;</span><span class="n">Seq</span><span class="p">,</span> <span class="mi">0</span><span class="o">&gt;::</span><span class="n">call</span><span class="p">();</span> <span class="p">}</span> </pre></div></div><p> <a class="ext-link" href="http://melpon.org/wandbox/permlink/0LiQIP59uLbWXFR6"><span class="icon">​</span>Link to wandbox</a> </p> <p> As stated in the comment, the code works fine when <code>const</code> is removed. </p> <p> I think that <code>struct_member_name</code> should call <code>std::remove_const</code> or <code>std::remove_cv</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12344 Trac 1.4.3 Kohei Takahashi Wed, 12 Oct 2016 14:55:19 GMT <link>https://svn.boost.org/trac10/ticket/12344#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12344#comment:1</guid> <description> <p> AFAIK, <code>boost::fusion::extension</code> namespace is not for user code. Joel, any suggestion? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 12 Oct 2016 21:07:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12344#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12344#comment:2</guid> <description> <p> Not sure if I understand... what is the relevance of boost::fusion::extension here? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Kohei Takahashi</dc:creator> <pubDate>Thu, 13 Oct 2016 15:29:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12344#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12344#comment:3</guid> <description> <p> Most of (I think all of) public interfaces uses <code>fusion::extension</code> with <code>remove_const</code>, i.e. it is not necessary to use <code>remove_const</code> within <code>fusion::extension</code>; I suspect <code>fusion::extension</code> is internal use only. However there is no public interface which counterpart of <code>extension::struct_member_name</code>, thus user wants <code>remove_const</code> to be applied to <code>extension::struct_member_name</code>. </p> <p> IMO, it is by design, i.e. <em>wontfix</em>. </p> </description> <category>Ticket</category> </item> </channel> </rss>