diff --git a/include/boost/thread/concurrent_queues/queue_adaptor.hpp b/include/boost/thread/concurrent_queues/queue_adaptor.hpp index 3259c284..d293b321 100644 --- a/include/boost/thread/concurrent_queues/queue_adaptor.hpp +++ b/include/boost/thread/concurrent_queues/queue_adaptor.hpp @@ -45,24 +45,26 @@ namespace concurrent void close() { queue.close(); } void push_back(const value_type& x) { queue.push_back(x); } - void push_back(BOOST_THREAD_RV_REF(value_type) x) { queue.push_back(boost::forward(x)); } void pull_front(value_type& x) { queue.pull_front(x); }; // enable_if is_nothrow_copy_movable value_type pull_front() { return queue.pull_front(); } queue_op_status try_push_back(const value_type& x) { return queue.try_push_back(x); } - queue_op_status try_push_back(BOOST_THREAD_RV_REF(value_type) x) { return queue.try_push_back(boost::forward(x)); } queue_op_status try_pull_front(value_type& x) { return queue.try_pull_front(x); } queue_op_status nonblocking_push_back(const value_type& x) { return queue.nonblocking_push_back(x); } - queue_op_status nonblocking_push_back(BOOST_THREAD_RV_REF(value_type) x) { return queue.nonblocking_push_back(boost::forward(x)); } queue_op_status nonblocking_pull_front(value_type& x) { return queue.nonblocking_pull_front(x); } queue_op_status wait_push_back(const value_type& x) { return queue.wait_push_back(x); } - queue_op_status wait_push_back(BOOST_THREAD_RV_REF(value_type) x) { return queue.wait_push_back(boost::forward(x)); } queue_op_status wait_pull_front(value_type& x) { return queue.wait_pull_front(x); } +#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES + void push_back(BOOST_THREAD_RV_REF(value_type) x) { queue.push_back(boost::move(x)); } + queue_op_status try_push_back(BOOST_THREAD_RV_REF(value_type) x) { return queue.try_push_back(boost::move(x)); } + queue_op_status nonblocking_push_back(BOOST_THREAD_RV_REF(value_type) x) { return queue.nonblocking_push_back(boost::move(x)); } + queue_op_status wait_push_back(BOOST_THREAD_RV_REF(value_type) x) { return queue.wait_push_back(boost::move(x)); } +#endif }; } diff --git a/include/boost/thread/concurrent_queues/queue_base.hpp b/include/boost/thread/concurrent_queues/queue_base.hpp index 68e3f9e8..e7680497 100755 --- a/include/boost/thread/concurrent_queues/queue_base.hpp +++ b/include/boost/thread/concurrent_queues/queue_base.hpp @@ -42,24 +42,26 @@ namespace concurrent virtual void close() = 0; virtual void push_back(const value_type& x) = 0; - virtual void push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; virtual void pull_front(value_type&) = 0; // enable_if is_nothrow_copy_movable virtual value_type pull_front() = 0; virtual queue_op_status try_push_back(const value_type& x) = 0; - virtual queue_op_status try_push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; virtual queue_op_status try_pull_front(value_type&) = 0; virtual queue_op_status nonblocking_push_back(const value_type& x) = 0; - virtual queue_op_status nonblocking_push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; virtual queue_op_status nonblocking_pull_front(value_type&) = 0; virtual queue_op_status wait_push_back(const value_type& x) = 0; - virtual queue_op_status wait_push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; virtual queue_op_status wait_pull_front(ValueType& elem) = 0; +#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES + virtual void push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; + virtual queue_op_status try_push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; + virtual queue_op_status nonblocking_push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; + virtual queue_op_status wait_push_back(BOOST_THREAD_RV_REF(value_type) x) = 0; +#endif }; diff --git a/include/boost/thread/concurrent_queues/queue_views.hpp b/include/boost/thread/concurrent_queues/queue_views.hpp index ec488b38..0a4d220c 100644 --- a/include/boost/thread/concurrent_queues/queue_views.hpp +++ b/include/boost/thread/concurrent_queues/queue_views.hpp @@ -44,26 +44,28 @@ namespace concurrent void close() { queue.close(); } void push(const value_type& x) { queue.push_back(x); } - void push(BOOST_THREAD_RV_REF(value_type) x) { queue.push_back(forward(x)); } void pull(value_type& x) { queue.pull_back(x); } // enable_if is_nothrow_copy_movable value_type pull() { return queue.pull_back(); } queue_op_status try_push(const value_type& x) { return queue.try_push_back(x); } - queue_op_status try_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.try_push_back(forward(x)); } queue_op_status try_pull(value_type& x) { return queue.try_pull_back(x); } queue_op_status nonblocking_push(const value_type& x) { return queue.nonblocking_push_back(x); } - queue_op_status nonblocking_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.nonblocking_push_back(forward(x)); } queue_op_status nonblocking_pull(value_type& x) { return queue.nonblocking_pull_back(x); } queue_op_status wait_push(const value_type& x) { return queue.wait_push_back(x); } - queue_op_status wait_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.wait_push_back(forward(x)); } queue_op_status wait_pull_front(value_type& x) { return queue.wait_pull_back(x); } +#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES + void push(BOOST_THREAD_RV_REF(value_type) x) { queue.push_back(boost::move(x)); } + queue_op_status try_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.try_push_back(boost::move(x)); } + queue_op_status nonblocking_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.nonblocking_push_back(boost::move(x)); } + queue_op_status wait_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.wait_push_back(boost::move(x)); } +#endif }; template @@ -87,25 +89,27 @@ namespace concurrent void close() { queue.close(); } void push(const value_type& x) { queue.push_front(x); } - void push(BOOST_THREAD_RV_REF(value_type) x) { queue.push_front(forward(x)); } void pull(value_type& x) { queue.pull_front(x); }; // enable_if is_nothrow_copy_movable value_type pull() { return queue.pull_front(); } queue_op_status try_push(const value_type& x) { return queue.try_push_front(x); } - queue_op_status try_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.try_push_front(forward(x)); } queue_op_status try_pull(value_type& x) { return queue.try_pull_front(x); } queue_op_status nonblocking_push(const value_type& x) { return queue.nonblocking_push_front(x); } - queue_op_status nonblocking_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.nonblocking_push_front(forward(x)); } queue_op_status nonblocking_pull(value_type& x) { return queue.nonblocking_pull_front(x); } queue_op_status wait_push(const value_type& x) { return queue.wait_push_front(x); } - queue_op_status wait_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.wait_push_front(forward(x)); } queue_op_status wait_pull(value_type& x) { return queue.wait_pull_front(x); } +#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES + void push(BOOST_THREAD_RV_REF(value_type) x) { queue.push_front(forward(x)); } + queue_op_status try_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.try_push_front(forward(x)); } + queue_op_status nonblocking_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.nonblocking_push_front(forward(x)); } + queue_op_status wait_push(BOOST_THREAD_RV_REF(value_type) x) { return queue.wait_push_front(forward(x)); } +#endif }; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 40544c2b..169d6b55 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -720,6 +720,7 @@ rule thread-compile ( sources : reqs * : name ) [ thread-run2-noit ../example/ba_externallly_locked.cpp : ex_ba_externallly_locked ] [ thread-run2 ../example/producer_consumer_bounded.cpp : ex_producer_consumer_bounded ] [ thread-run2 ../example/producer_consumer.cpp : ex_producer_consumer ] + [ thread-run2 ../example/producer_consumer2.cpp : ex_producer_consumer2 ] [ thread-run2 ../example/not_interleaved.cpp : ex_not_interleaved ] [ thread-run2 ../example/lambda_future.cpp : ex_lambda_future ] [ thread-run2 ../example/not_interleaved2.cpp : ex_not_interleaved2 ] @@ -850,7 +851,6 @@ rule thread-compile ( sources : reqs * : name ) #[ thread-run test_9720.cpp ] #[ thread-run test_10125.cpp ] #[ thread-run test_10128.cpp ] - [ thread-run2 ../example/producer_consumer2.cpp : ex_producer_consumer2 ] ; }