Boost C++ Libraries: Ticket #12388: useless static const generated by BOOST_SPIRIT_DEFINE_? https://svn.boost.org/trac10/ticket/12388 <p> The purpose of creating of a static variable here: </p> <blockquote> <p> <a class="ext-link" href="https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/rule.hpp#L164"><span class="icon">​</span>https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/rule.hpp#L164</a> </p> </blockquote> <p> is not apparent. Why wouldn't the following replacement: </p> <blockquote> <p> auto const&amp; def_=BOOST_PP_CAT(rule_name, _def); </p> </blockquote> <p> work just as well. If not, some source code comments explaining the need for creating a new instance of a struct would help maintainers and people trying to understand the code. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12388 Trac 1.4.3 cppljevans@… Wed, 10 Aug 2016 19:24:19 GMT <link>https://svn.boost.org/trac10/ticket/12388#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12388#comment:1</guid> <description> <p> Replying to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12388" title="#12388: Bugs: useless static const generated by BOOST_SPIRIT_DEFINE_? (closed: fixed)">cppljevans@…</a>: </p> <blockquote class="citation"> <p> The purpose of creating of a static variable here: </p> <blockquote> <p> <a class="ext-link" href="https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/rule.hpp#L164"><span class="icon">​</span>https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/rule.hpp#L164</a> </p> </blockquote> <p> is not apparent. Why wouldn't the following replacement: </p> <blockquote> <p> auto const&amp; def_=BOOST_PP_CAT(rule_name, _def); </p> </blockquote> <p> work just as well. If not, some source code comments explaining the need for creating a new instance of a struct would help maintainers and people trying to understand the code. </p> </blockquote> <p> Closer inspection of rule_definition shows it handles attributes. Sorry for noise. Please ignore this ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 19 Aug 2016 21:18:15 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/12388#comment:2 https://svn.boost.org/trac10/ticket/12388#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Joel de Guzman</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">spirit</span> </li> </ul> Ticket Joel de Guzman Mon, 18 Dec 2017 23:25:03 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12388#comment:3 https://svn.boost.org/trac10/ticket/12388#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket