Modify

Opened 7 months ago

Closed 3 months ago

#12874 closed Patches (fixed)

future<> extension constructor must be under BOOST_THREAD_PROVIDES_FUTURE_UNWRAP

Reported by: Arthur O'Dwyer Owned by: viboes
Milestone: Boost 1.65.0 Component: thread
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

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.

Attachments (0)

Change History (3)

comment:1 Changed 5 months ago by viboes

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:3 Changed 3 months ago by viboes

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.