Boost C++ Libraries: Ticket #9112: [tr1] Failures in test_ref_wrapper_tricky.cpp https://svn.boost.org/trac10/ticket/9112 <p> The mentioned test case gives a number of failures. Those can be tracked down to two problems (at least the test case perceives them as problems). Google gives hits dating this back to 1.37, I have confirmed it with 1.41 and 1.54. I'm not sure why this hasn't been addressed--have I inadvertently opened a can of worms? </p> <p> First, reference_wrapper that wraps function-like objects doesn't derive off std::unary_function, resp. std::binary function. That's relatively easy to fix by introducing a reference_wrapper_base class template, that reference_wrapper inherits off. That template optionally derives off unary_ or binary_function as appropriate. </p> <p> Second, calling reference wrapper as function doesn't work for member functions. This can be solved by introducing operator() in the above mentioned base class. </p> <p> I'll attach a patch that implements the above, except for specializations for reference_wrapper&lt;{binary,unary}_function&gt;. Please let me know whether a patch to this effect would be applicable and advise on areas that need more work. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9112 Trac 1.4.3 Petr Machata <pmachata@…> Fri, 13 Sep 2013 16:24:21 GMT attachment set https://svn.boost.org/trac10/ticket/9112 https://svn.boost.org/trac10/ticket/9112 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-0.41.0-tr1-ref.patch</span> </li> </ul> <p> Proposed patch. </p> Ticket Petr Machata <pmachata@…> Fri, 13 Sep 2013 16:26:28 GMT <link>https://svn.boost.org/trac10/ticket/9112#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9112#comment:1</guid> <description> <p> The errors reported by the test case look like this: </p> <pre class="wiki">gcc.compile.c++ ../../../bin.v2/libs/tr1/test/test_ref_wrapper_tricky.test/gcc-4.6.3/debug/test_ref_wrapper_tricky.o test_ref_wrapper_tricky.cpp: In function 'int main()': test_ref_wrapper_tricky.cpp:42:220: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE&lt;false&gt;' test_ref_wrapper_tricky.cpp:42:221: error: template argument 1 is invalid test_ref_wrapper_tricky.cpp:42:254: error: invalid type in declaration before ';' token test_ref_wrapper_tricky.cpp:48:227: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE&lt;false&gt;' test_ref_wrapper_tricky.cpp:48:228: error: template argument 1 is invalid test_ref_wrapper_tricky.cpp:48:261: error: invalid type in declaration before ';' token test_ref_wrapper_tricky.cpp:64:34: error: no match for call to '(boost::reference_wrapper&lt;functor1&gt;) (int&amp;)' test_ref_wrapper_tricky.cpp:75:41: error: no match for call to '(boost::reference_wrapper&lt;functor2&gt;) (int&amp;, int&amp;)' test_ref_wrapper_tricky.cpp:79:9: warning: unused variable 'ri' [-Wunused-variable] test_ref_wrapper_tricky.cpp:80:15: warning: unused variable 'cri' [-Wunused-variable] </pre><p> Those two are from the unary_function and binary_function specializations that I haven't fixed, as mentioned above. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 13 Sep 2013 17:00:15 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/9112#comment:2 https://svn.boost.org/trac10/ticket/9112#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">TR1</span> → <span class="trac-field-new">result_of</span> </li> </ul> <p> Reassigning as this is an issue with Boost.Ref not really TR1. </p> Ticket