Re: [Boost-bugs] [Boost C++ Libraries] #8674: Futures as local named objects can't be returned with implicit move.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8674: Futures as local named objects can't be returned with implicit move.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-09 11:16:23


#8674: Futures as local named objects can't be returned with implicit move.
-------------------------------+----------------------
  Reporter: mjklaim@… | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------

Comment (by mjklaim@…):

 Ok I found something. In delete.hpp:

 {{{

 /**
  * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the
 compiler supports it or
  * makes it private.
  *
  * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the
 compiler supports it or
  * makes it private.
  */
 #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
       CLASS(CLASS const&) = delete; \

 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
       CLASS& operator=(CLASS const&) = delete;

 #else // BOOST_NO_CXX11_DELETED_FUNCTIONS
 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
     private: \
       CLASS(CLASS&); \ // <--- HERE
     public:

 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
     private: \
       CLASS& operator=(CLASS&); \ // <--- HERE
     public:
 #endif // BOOST_NO_CXX11_DELETED_FUNCTIONS

 }}}


 Notice that the non-c++11 implementation define private copy constructor
 and assignation using '''non-const''' references.


 {{{
 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
     private: \
       CLASS(CLASS const &); \ // <--- HERE
     public:

 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
     private: \
       CLASS& operator=(CLASS const &); \ // <--- HERE
     public:

 }}}


 This compiles for me.
 (I just can't run it right now because it requires recompiling
 boost.thread)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8674#comment:9>
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:13 UTC