[Boost-bugs] [Boost C++ Libraries] #12292: [TypeErasure] Construction of any from static_binding fails if compiling with rvalue-ref support

Subject: [Boost-bugs] [Boost C++ Libraries] #12292: [TypeErasure] Construction of any from static_binding fails if compiling with rvalue-ref support
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-22 11:05:32


#12292: [TypeErasure] Construction of any from static_binding fails if compiling
with rvalue-ref support
-----------------------------------------+-----------------------------
 Reporter: Deniz Bahadir <D.Bahadir@…> | Owner: steven_watanabe
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_erasure
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-----------------------------------------+-----------------------------
 Although the documentation of **Boost.Type``Erasure** explicitly shows how
 to default-construct an `any``` from the binding of another `any`, this
 seems not to work when rvalue-references are supported by the compiler.

  The reason is, that the wrong constructor overload is chosen.

 `binding_of``` returns a `static_binding``` for which no explicit
 `any`-constructor is available. If rvalue-references are not supported by
 the compiler the constructor-overload which takes a `binding``` is chosen
 (due to implicit conversion from `static_binding``` to `binding`).

 If rvalue-references are supported the constructor which takes a
 "universal reference" `[1]``` is chosen instead which does not expect and
 therefore cannot handle the `static_binding`.

 `[1]` https://isocpp.org/blog/2012/11/universal-references-in-c11-scott-
 meyers

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12292>
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:20 UTC