[Boost-bugs] [Boost C++ Libraries] #10277: reference_wrapper & implicit conversion to parent types

Subject: [Boost-bugs] [Boost C++ Libraries] #10277: reference_wrapper & implicit conversion to parent types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-30 03:02:00


#10277: reference_wrapper & implicit conversion to parent types
--------------------------------------+------------------------------
 Reporter: Christopher <kemsleyc@…> | Type: Feature Requests
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.55.0
 Severity: Problem | Keywords:
--------------------------------------+------------------------------
 I propose a change to reference_wrapper which enables implicit conversion
 to references and reference_wrappers of base types.

 One motivation for this is an unconventional use of reference_wrapper:

 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.

 However, this is currently not possible without creating a custom
 implementation of reference_wrapper.

 I have attached a proposed modification to the boost 1.55.0
 implementation, as well as a simple file testing the extended capability.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10277>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC