Boost C++ Libraries: Ticket #2793: function types don't work for named template type parameters https://svn.boost.org/trac10/ticket/2793 <p> See this thread for a more detailed description: </p> <p> <a class="ext-link" href="http://www.nabble.com/-parameter--function-types-as-named-template-parameters--td21614543.html"><span class="icon">​</span>http://www.nabble.com/-parameter--function-types-as-named-template-parameters--td21614543.html</a> </p> <p> Dave Abrahams posted a patch for this problem to the mailing list, I will attach it to this ticket. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2793 Trac 1.4.3 Frank Mori Hess Sun, 22 Feb 2009 17:17:53 GMT attachment set https://svn.boost.org/trac10/ticket/2793 https://svn.boost.org/trac10/ticket/2793 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">template_keyword.1.patch</span> </li> </ul> <p> Patch from David Abrahams for boost/parameter/aux_/template_keyword.hpp </p> Ticket Frank Mori Hess Mon, 24 May 2010 20:32:07 GMT attachment set https://svn.boost.org/trac10/ticket/2793 https://svn.boost.org/trac10/ticket/2793 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">function_type_named_parameter.cpp</span> </li> </ul> <p> compile test for passing function type as named template parameter </p> Ticket Frank Mori Hess Tue, 25 May 2010 15:11:33 GMT <link>https://svn.boost.org/trac10/ticket/2793#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2793#comment:1</guid> <description> <p> The function_type_named_parameter.cpp test actually fails even with the patch, due to the function type being changed into a reference to function type. I believe the test is valid and the patch is not quite right. I couldn't say exactly what practical difference it would make that the function type is changed into a reference to function type, but it seems wrong that the type is not exactly preserved. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>expaler</dc:creator> <pubDate>Thu, 17 Mar 2011 03:34:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2793#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2793#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2793#comment:1" title="Comment 1">fmhess</a>: </p> <blockquote class="citation"> <p> I believe the test is valid and the patch is not quite right. </p> </blockquote> <p> I hope you don't mind if I disagree with your assessment. The reference documentation <em>does</em> state that the <code>binding</code> metafunction returns the reference type rather than the value type. Of course, if the patch is applied, then perhaps the documentation should be changed to reflect the fact that the metafunction returns the reference type only if the tagged reference is a primitive function or array. Or perhaps not, since metaprogrammers can just <code>add_reference</code>. </p> <p> In any case, I don't see why legacy code that is already broken for function types shouldn't be changed to use <code>value_type</code> instead of <code>binding</code>. I vote to have the patch applied. </p> </description> <category>Ticket</category> </item> <item> <author>Louis Dionne <louis.dionne92@…></author> <pubDate>Wed, 30 Jan 2013 02:18:36 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2793 https://svn.boost.org/trac10/ticket/2793 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">arg_list.diff</span> </li> </ul> <p> temporary workaround </p> Ticket Louis Dionne <louis.dionne92@…> Wed, 30 Jan 2013 02:19:47 GMT <link>https://svn.boost.org/trac10/ticket/2793#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2793#comment:3</guid> <description> <p> I have run into this problem too. </p> <p> Instead of changing the definition of <code>reference</code>, I opted for a more conservative solution. Since I was getting compiler errors in the declarations of some member functions of <code>arg_list</code>, I changed these declarations so that the problematic types are dependent on a template parameter. Since the functions are never actually used for named template parameters, the signatures are not instantiated and the compiler does not complain. </p> <p> Attached is a patch that makes the <code>function_type_named_parameter.cpp</code> test pass. My own code also works with this patch. While this is a hacky workaround, I believe it is still better than nothing until a definite solution can be settled on. </p> <p> I compiled with Clang 3.2 and G++ 4.7.2. </p> </description> <category>Ticket</category> </item> </channel> </rss>