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:05:58
#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:6> 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