Re: [Boost-bugs] [Boost C++ Libraries] #10340: No boost::promise<T>::set_value(const T&) overload present in C++03 mode

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10340: No boost::promise<T>::set_value(const T&) overload present in C++03 mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-08-30 10:06:49


#10340: No boost::promise<T>::set_value(const T&) overload present in C++03 mode
-------------------------------+----------------------
  Reporter: rob.desbois@… | Owner: anthonyw
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------
Description changed by viboes:

Old description:

> When compiling in C++03 mode I am unable to use anything but a primitive
> type in a promise, and therefore also the dependent types in Boost.Thread
>
> Minimal testcase:
> #include <boost/thread/future.hpp>
>
> struct foo
> {
> foo(int i_): i(i_) {}
> int i;
> };
>
> int main()
> {
> // Clearly a const future ref isn't much use, but I needed to
> // prove the problem wasn't me trying to copy a unique_future
>
> const boost::unique_future<foo>& fut =
> boost::make_ready_future( foo(42) );
> }
>

> Output from g++ 4.8.2 with Boost 1.55 and -DBOOST_THREAD_USES_MOVE:
> In file included from
> ../../deps/boost/include/boost/tuple/tuple.hpp:33:0,
> from
> ../../deps/boost/include/boost/thread/detail/async_func.hpp:37,
> from
> ../../deps/boost/include/boost/thread/future.hpp:22,
> from t.cpp:2:
> ../../deps/boost/include/boost/tuple/detail/tuple_basic.hpp: In
> function ‘typename boost::tuples::access_traits<typename
> boost::tuples::element<N, boost::tuples::cons<HT, TT>
> >::type>::const_type boost::tuples::get(const boost::tuples::cons<HT,
> TT>&)’:
> ../../deps/boost/include/boost/tuple/detail/tuple_basic.hpp:228:45:
> warning: typedef ‘cons_element’ locally defined but not used [-Wunused-
> local-typedefs]
> typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
> ^
> In file included from
> ../../deps/boost/include/boost/bind/bind.hpp:29:0,
> from ../../deps/boost/include/boost/bind.hpp:22,
> from
> ../../deps/boost/include/boost/thread/future.hpp:41,
> from t.cpp:2:
> ../../deps/boost/include/boost/bind/arg.hpp: In constructor
> ‘boost::arg<I>::arg(const T&)’:
> ../../deps/boost/include/boost/bind/arg.hpp:37:22: warning: typedef
> ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-
> typedefs]
> typedef char T_must_be_placeholder[ I ==
> is_placeholder<T>::value? 1: -1 ];
> ^
> t.cpp: In function ‘int main()’:
> t.cpp:12:78: error: expected primary-expression before ‘f’
> const boost::unique_future<foo>& fut =
> boost::make_ready_future( foo f(42) );
> ^
> t.cpp:12:42: warning: unused variable ‘fut’ [-Wunused-variable]
> const boost::unique_future<foo>& fut =
> boost::make_ready_future( foo f(42) );
> ^
> In file included from
> ../../deps/boost/include/boost/system/system_error.hpp:14:0,
> from
> ../../deps/boost/include/boost/thread/exceptions.hpp:22,
> from
> ../../deps/boost/include/boost/thread/pthread/mutex.hpp:12,
> from
> ../../deps/boost/include/boost/thread/mutex.hpp:16,
> from
> ../../deps/boost/include/boost/thread/future.hpp:24,
> from t.cpp:2:
> ../../deps/boost/include/boost/system/error_code.hpp: At global
> scope:
> ../../deps/boost/include/boost/system/error_code.hpp:222:36: warning:
> ‘boost::system::posix_category’ defined but not used [-Wunused-variable]
> static const error_category & posix_category =
> generic_category();
> ^
> ../../deps/boost/include/boost/system/error_code.hpp:223:36: warning:
> ‘boost::system::errno_ecat’ defined but not used [-Wunused-variable]
> static const error_category & errno_ecat =
> generic_category();
> ^
> ../../deps/boost/include/boost/system/error_code.hpp:224:36: warning:
> ‘boost::system::native_ecat’ defined but not used [-Wunused-variable]
> static const error_category & native_ecat =
> system_category();
>

> I have replicated this with Clang 3.4, also with Boost 1.54 on both
> compilers, and without -DBOOST_THREAD_USES_MOVE too.
> From the boost-users mailing list it looks like it has been replicated
> with 1.56 too.

New description:

 When compiling in C++03 mode I am unable to use anything but a primitive
 type in a promise, and therefore also the dependent types in Boost.Thread

 Minimal testcase:


 {{{
     #include <boost/thread/future.hpp>

     struct foo
     {
         foo(int i_): i(i_) {}
         int i;
     };

     int main()
     {
         // Clearly a const future ref isn't much use, but I needed to
         // prove the problem wasn't me trying to copy a unique_future

         const boost::unique_future<foo>& fut = boost::make_ready_future(
 foo(42) );
     }
 }}}



 Output from g++ 4.8.2 with Boost 1.55 and -DBOOST_THREAD_USES_MOVE:
     In file included from
 ../../deps/boost/include/boost/tuple/tuple.hpp:33:0,
                      from
 ../../deps/boost/include/boost/thread/detail/async_func.hpp:37,
                      from
 ../../deps/boost/include/boost/thread/future.hpp:22,
                      from t.cpp:2:
     ../../deps/boost/include/boost/tuple/detail/tuple_basic.hpp: In
 function ‘typename boost::tuples::access_traits<typename
 boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::const_type
 boost::tuples::get(const boost::tuples::cons<HT, TT>&)’:
     ../../deps/boost/include/boost/tuple/detail/tuple_basic.hpp:228:45:
 warning: typedef ‘cons_element’ locally defined but not used [-Wunused-
 local-typedefs]
        typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
                                                  ^
     In file included from
 ../../deps/boost/include/boost/bind/bind.hpp:29:0,
                      from ../../deps/boost/include/boost/bind.hpp:22,
                      from
 ../../deps/boost/include/boost/thread/future.hpp:41,
                      from t.cpp:2:
     ../../deps/boost/include/boost/bind/arg.hpp: In constructor
 â€˜boost::arg<I>::arg(const T&)’:
     ../../deps/boost/include/boost/bind/arg.hpp:37:22: warning: typedef
 â€˜T_must_be_placeholder’ locally defined but not used [-Wunused-local-
 typedefs]
              typedef char T_must_be_placeholder[ I ==
 is_placeholder<T>::value? 1: -1 ];
                           ^
     t.cpp: In function ‘int main()’:
     t.cpp:12:78: error: expected primary-expression before ‘f’
              const boost::unique_future<foo>& fut =
 boost::make_ready_future( foo f(42) );
 ^
     t.cpp:12:42: warning: unused variable ‘fut’ [-Wunused-variable]
              const boost::unique_future<foo>& fut =
 boost::make_ready_future( foo f(42) );
                                               ^
     In file included from
 ../../deps/boost/include/boost/system/system_error.hpp:14:0,
                      from
 ../../deps/boost/include/boost/thread/exceptions.hpp:22,
                      from
 ../../deps/boost/include/boost/thread/pthread/mutex.hpp:12,
                      from
 ../../deps/boost/include/boost/thread/mutex.hpp:16,
                      from
 ../../deps/boost/include/boost/thread/future.hpp:24,
                      from t.cpp:2:
     ../../deps/boost/include/boost/system/error_code.hpp: At global scope:
     ../../deps/boost/include/boost/system/error_code.hpp:222:36: warning:
 â€˜boost::system::posix_category’ defined but not used [-Wunused-variable]
          static const error_category & posix_category =
 generic_category();
                                         ^
     ../../deps/boost/include/boost/system/error_code.hpp:223:36: warning:
 â€˜boost::system::errno_ecat’ defined but not used [-Wunused-variable]
          static const error_category & errno_ecat =
 generic_category();
                                         ^
     ../../deps/boost/include/boost/system/error_code.hpp:224:36: warning:
 â€˜boost::system::native_ecat’ defined but not used [-Wunused-variable]
          static const error_category & native_ecat =
 system_category();


 I have replicated this with Clang 3.4, also with Boost 1.54 on both
 compilers, and without -DBOOST_THREAD_USES_MOVE too.
 From the boost-users mailing list it looks like it has been replicated
 with 1.56 too.

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