Boost C++ Libraries: Ticket #7300: Custom terminals are always nullary https://svn.boost.org/trac10/ticket/7300 <p> The is_nullary trait is specialized for custom_terminal&lt;T&gt; and returns true. There is no way to specialize is_nullary for a template custom terminal so that it returns false. </p> <p> The attached code sample illustrates the problem, I could not make it compile with GCC 4.6. More details available in <a class="ext-link" href="http://lists.boost.org/Archives/boost/2012/08/195888.php"><span class="icon">​</span>this</a> thread. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7300 Trac 1.4.3 Andrey Semashev Tue, 28 Aug 2012 18:07:41 GMT attachment set https://svn.boost.org/trac10/ticket/7300 https://svn.boost.org/trac10/ticket/7300 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">terminal_test.cpp</span> </li> </ul> <p> Code sample that illustrates the problem </p> Ticket Thomas Heller Wed, 29 Aug 2012 06:04:03 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7300#comment:1 https://svn.boost.org/trac10/ticket/7300#comment:1 <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> <p> Sorry for the delay ... looks like there is something wrong with my mail client ... I replied to your message to the mailing list already ... </p> <p> The solution is here: </p> <pre class="wiki">namespace my { template &lt;typename&gt; class output_terminal; } namespace boost { namespace phoenix { namespace result_of { template&lt; typename T &gt; struct is_nullary&lt; custom_terminal&lt; my::output_terminal&lt;T&gt; &gt; &gt; : public mpl::false_ {}; </pre><p> }}} </p> <p> Put this at the beginning of your file and it compiles and runs. The is_nullary specialization needs to be wrapped inside another custom_terminal template in order to disambiguate from other rules. </p> Ticket Andrey Semashev Wed, 29 Aug 2012 06:32:03 GMT <link>https://svn.boost.org/trac10/ticket/7300#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7300#comment:2</guid> <description> <p> Thanks for the answer, it worked. Could the specialization in Boost.Phoenix be made more specific (for example, by using the nested void type technique) so that it is possible to create more generic specializations in user's code, like this: </p> <pre class="wiki">template&lt; typename T &gt; struct is_nullary&lt; custom_terminal&lt; T &gt;, typename T::_is_my_terminal &gt; : public mpl::false_ { }; </pre> </description> <category>Ticket</category> </item> </channel> </rss>