Boost C++ Libraries: Ticket #10277: reference_wrapper & implicit conversion to parent types https://svn.boost.org/trac10/ticket/10277 <p> I propose a change to reference_wrapper which enables implicit conversion to references and reference_wrappers of base types. </p> <p> One motivation for this is an unconventional use of reference_wrapper: </p> <p> Many common library functions in code have a non-trivial set of arguments, some of which being non-const references. When reading code that uses these functions, it is often difficult to tell what side-effects a library function has from call to call. Having a coding policy that mutable references must be reference_wrappers and having calling code use ref() enables readers of the callsites to clearly identify which arguments have the possibility of having side-effects. </p> <p> However, this is currently not possible without creating a custom implementation of reference_wrapper. </p> <p> I have attached a proposed modification to the boost 1.55.0 implementation, as well as a simple file testing the extended capability. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10277 Trac 1.4.3 Christopher <kemsleyc@…> Wed, 30 Jul 2014 03:02:41 GMT attachment set https://svn.boost.org/trac10/ticket/10277 https://svn.boost.org/trac10/ticket/10277 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ref.hpp</span> </li> </ul> Ticket Christopher <kemsleyc@…> Wed, 30 Jul 2014 03:02:54 GMT attachment set https://svn.boost.org/trac10/ticket/10277 https://svn.boost.org/trac10/ticket/10277 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> Ticket Christopher <kemsleyc@…> Wed, 30 Jul 2014 03:05:56 GMT attachment set https://svn.boost.org/trac10/ticket/10277 https://svn.boost.org/trac10/ticket/10277 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">diff.txt</span> </li> </ul> Ticket viboes Sat, 02 Aug 2014 14:58:51 GMT component changed; owner set https://svn.boost.org/trac10/ticket/10277#comment:1 https://svn.boost.org/trac10/ticket/10277#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">bind</span> </li> </ul> Ticket