Boost C++ Libraries: Ticket #3114: Modified interface to allow even lazier return types for defaults https://svn.boost.org/trac10/ticket/3114 <p> There are some use cases where the return type of operator() in a default computation class is not valid in some cases when that default is not used. The current interface to such classes does not allow that case; see the message at <a class="ext-link" href="http://lists.boost.org/Archives/boost/2009/05/152009.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2009/05/152009.php</a> for more information. The attached patch allows a special member type (that must be void) to be used to change the interface to pass a single int argument to operator(), while keeping the old no-parameter interface for function objects without the special tag. The tag could also have been implemented as a traits class used with enable_if. The patch passes all of the Boost.Parameter tests except two (which appear to freeze up). I only changed the normal path through the code, and not the compatibility code which I am unable to test. A test for the new functionality added by the patch is also attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3114 Trac 1.4.3 Jeremiah Willcock Sat, 30 May 2009 23:52:27 GMT attachment set https://svn.boost.org/trac10/ticket/3114 https://svn.boost.org/trac10/ticket/3114 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">parameter_interface.patch</span> </li> </ul> <p> Patch to allow alternative interface </p> Ticket Jeremiah Willcock Sat, 30 May 2009 23:52:48 GMT attachment set https://svn.boost.org/trac10/ticket/3114 https://svn.boost.org/trac10/ticket/3114 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">parameter_test.cpp</span> </li> </ul> <p> Test using new interface </p> Ticket Jeremiah Willcock Sun, 31 May 2009 00:29:11 GMT type changed https://svn.boost.org/trac10/ticket/3114#comment:1 https://svn.boost.org/trac10/ticket/3114#comment:1 <ul> <li><strong>type</strong> <span class="trac-field-old">Patches</span> → <span class="trac-field-new">Feature Requests</span> </li> </ul> Ticket Jeremiah Willcock Fri, 05 Jun 2009 19:51:34 GMT <link>https://svn.boost.org/trac10/ticket/3114#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3114#comment:2</guid> <description> <p> The patch might need to be changed so that it gets result_of&lt;F(int)&gt;::type rather than result_of&lt;F()&gt;::type because that second case does not use a result member template in F while the first one does. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Sat, 17 Oct 2009 01:29:29 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/3114#comment:3 https://svn.boost.org/trac10/ticket/3114#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Daniel Wallin</span> to <span class="trac-author">Jeremiah Willcock</span> </li> </ul> <p> Jeremiah, </p> <p> I don't completely understand the problem you're solving, but if you can assure me that no documentation changes are needed for this, then I trust you to check in your changes on trunk and move them to release when the results look clean. </p> Ticket Jeremiah Willcock Mon, 19 Oct 2009 17:00:35 GMT owner, milestone changed https://svn.boost.org/trac10/ticket/3114#comment:4 https://svn.boost.org/trac10/ticket/3114#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Jeremiah Willcock</span> to <span class="trac-author">Daniel Wallin</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.40.0</span> → <span class="trac-field-new">Boost 1.42.0</span> </li> </ul> <p> I believe that it should require documentation changes (to document the new interface), and possibly a change (backwards-incompatible) to only use the new interface with the dummy parameter (if you want). I do not believe this patch is ready for 1.41 and should be understood fully before being added. You may want to rewrite it anyway to match your coding standard, naming conventions, etc. I am sending this back to you to be delayed until 1.42 and checked in more detail. </p> Ticket Jeremiah Willcock Sat, 07 Nov 2009 17:51:43 GMT attachment set https://svn.boost.org/trac10/ticket/3114 https://svn.boost.org/trac10/ticket/3114 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">parameter_extra_lazy.cpp</span> </li> </ul> <p> An example program that fails with zero-argument use of result_of (the old behavior) </p> Ticket Dave Abrahams Sun, 08 Nov 2009 02:48:07 GMT <link>https://svn.boost.org/trac10/ticket/3114#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3114#comment:5</guid> <description> <p> Okay, the things you want here might be nice to have overall, but you don't need them to solve your problems. You're doing everything the hard way by not using the macros that generate the overload set. I'm attaching a patch to depth_first_search that makes everything work. </p> <p> If you read the comments in the patch, you'll see that there <em>are</em> a few places here and there where Boost.Parameter could be a big help if it did things differently. We should generate tickets for those. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Sun, 08 Nov 2009 02:49:04 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/3114 https://svn.boost.org/trac10/ticket/3114 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">depth_first_search.hpp.patch</span> </li> </ul> <p> Patch that parameter-enables depth_first_search without changes to Boost.Parameter </p> Ticket Dave Abrahams Sat, 09 Jan 2010 19:56:50 GMT owner changed https://svn.boost.org/trac10/ticket/3114#comment:6 https://svn.boost.org/trac10/ticket/3114#comment:6 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Daniel Wallin</span> to <span class="trac-author">Jeremiah Willcock</span> </li> </ul> Ticket