[Boost-bugs] [Boost C++ Libraries] #12874: future<> extension constructor must be under BOOST_THREAD_PROVIDES_FUTURE_UNWRAP

Subject: [Boost-bugs] [Boost C++ Libraries] #12874: future<> extension constructor must be under BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-28 00:00:54


#12874: future<> extension constructor must be under
BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
------------------------------+----------------------
 Reporter: Arthur O'Dwyer | Owner: anthonyw
     Type: Patches | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------
 In Boost 1.63.0's "boost/thread/future.hpp", we see this code:

 {{{
     inline explicit
 BOOST_THREAD_FUTURE(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE<BOOST_THREAD_FUTURE<R>
>) other); // EXTENSION
 }}}

 Unfortunately, the actual definition of this inline constructor is located
 under an #ifdef that may not be defined at compile time:

 {{{
 #if defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
 // many lines snipped...
   template <typename R>
   inline
 BOOST_THREAD_FUTURE<R>::BOOST_THREAD_FUTURE(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE<BOOST_THREAD_FUTURE<R>
>) other)
   : base_type(other.unwrap()) {}
 // several lines snipped...
 #endif
 }}}

 The result is that this inline constructor is declared but not defined,
 which produces very confusing linker errors.

 The appropriate solution is to wrap the declaration of this constructor in

 {{{
 #if defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
 #endif
 }}}

 No other change needs to be made, as far as I know.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12874>
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-28 00:04:02 UTC