diff --git a/example/doc_move_return.cpp b/example/doc_move_return.cpp index 19ed61e..0ac2fab 100644 --- a/example/doc_move_return.cpp +++ b/example/doc_move_return.cpp @@ -9,8 +9,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include - //[move_return_example #include "movable.hpp" #include "copymovable.hpp" @@ -61,7 +59,7 @@ int main() copyable c = lock_wrapper(factory_functor ()); non_copy_movable &mr = lock_wrapper(return_reference ()); //<- - boost::ignore_unused(m); boost::ignore_unused(cm); boost::ignore_unused(c); boost::ignore_unused(mr); + boost::movelib::ignore(m); boost::movelib::ignore(cm); boost::movelib::ignore(c); boost::movelib::ignore(mr); //-> return 0; } diff --git a/include/boost/move/algo/adaptive_sort.hpp b/include/boost/move/algo/adaptive_sort.hpp index d1aa883..30fd0e7 100644 --- a/include/boost/move/algo/adaptive_sort.hpp +++ b/include/boost/move/algo/adaptive_sort.hpp @@ -15,7 +15,6 @@ #include #include -#include #if defined(BOOST_CLANG) || (defined(BOOST_GCC) && (BOOST_GCC >= 40600)) #pragma GCC diagnostic push @@ -172,7 +171,7 @@ void adaptive_sort_combine_blocks , Compare comp , bool merge_left) { - boost::ignore_unused(xbuf); + boost::movelib::ignore(xbuf); typedef typename iter_size::type size_type; size_type const l_reg_combined = size_type(2u*l_prev_merged); @@ -181,7 +180,7 @@ void adaptive_sort_combine_blocks size_type const n_reg_combined = len/l_reg_combined; RandIt combined_first = first; - boost::ignore_unused(l_total_combined); + boost::movelib::ignore(l_total_combined); BOOST_ASSERT(l_total_combined <= len); size_type const max_i = size_type(n_reg_combined + (l_irreg_combined != 0)); diff --git a/include/boost/move/algo/detail/adaptive_sort_merge.hpp b/include/boost/move/algo/detail/adaptive_sort_merge.hpp index 4d8675b..fcd579a 100644 --- a/include/boost/move/algo/detail/adaptive_sort_merge.hpp +++ b/include/boost/move/algo/detail/adaptive_sort_merge.hpp @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -323,7 +322,7 @@ void merge_blocks_bufferless { typedef typename iter_size::type size_type; size_type const key_count = needed_keys_count(n_block_a, n_block_b); - ::boost::ignore_unused(key_count); + ::boost::movelib::ignore(key_count); //BOOST_ASSERT(n_block_a || n_block_b); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted_and_unique(key_first, key_first + key_count, key_comp)); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(!n_block_b || n_block_a == count_if_with(key_first, key_first + key_count, key_comp, key_first[n_block_a])); @@ -627,7 +626,7 @@ void unstable_sort( RandIt first, RandIt last , XBuf & xbuf) { heap_sort(first, last, comp); - ::boost::ignore_unused(xbuf); + ::boost::movelib::ignore(xbuf); } template @@ -969,14 +968,14 @@ OutputIt op_merge_blocks_with_irreg RandIt const last_reg = first_reg + l_block; RandIt first_min = first_reg + size_type(next_key_idx*l_block); RandIt const last_min = first_min + l_block; - boost::ignore_unused(last_min); + boost::movelib::ignore(last_min); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first_reg, last_reg, comp)); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(!next_key_idx || boost::movelib::is_sorted(first_min, last_min, comp)); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT((!next_key_idx || !comp(*first_reg, *first_min ))); OutputIt orig_dest = dest; - boost::ignore_unused(orig_dest); + boost::movelib::ignore(orig_dest); dest = next_key_idx ? op_partial_merge_and_swap(first_irr, last_irr, first_reg, last_reg, first_min, dest, comp, op, is_stable) : op_partial_merge (first_irr, last_irr, first_reg, last_reg, dest, comp, op, is_stable); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(orig_dest, dest, comp)); @@ -1027,7 +1026,7 @@ void op_merge_blocks_left typedef typename iter_size::type size_type; size_type const key_count = needed_keys_count(n_block_a, n_block_b); - boost::ignore_unused(key_count); + boost::movelib::ignore(key_count); // BOOST_ASSERT(n_block_a || n_block_b); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted_and_unique(key_first, key_first + key_count, key_comp)); @@ -1058,7 +1057,7 @@ void op_merge_blocks_left RandIt const first_min = first2 + size_type(next_key_idx*l_block); RandIt const last_min = first_min + l_block; - boost::ignore_unused(last_min); + boost::movelib::ignore(last_min); RandIt const last2 = first2 + l_block; BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first1, last1, comp)); @@ -1104,7 +1103,7 @@ void op_merge_blocks_left (buffer, buffer+(last1-first1), first2, last2, first_min, buf_beg, buf_end, comp, op, is_range1_A); } - boost::ignore_unused(unmerged); + boost::movelib::ignore(unmerged); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first-l_block, unmerged, comp)); swap_and_update_key( key_next, key_range2, key_mid, first2, last2 @@ -1167,7 +1166,7 @@ void op_merge_blocks_left ( key_range2, key_mid, key_comp, first2, first_irr2, last_irr2 , buffer, l_block, n_block_left, min_check, max_check, comp, false, op); buffer = op(forward_t(), first_irr2, last_irr2, buffer); - boost::ignore_unused(buffer); + boost::movelib::ignore(buffer); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first-l_block, buffer, comp)); } @@ -1259,7 +1258,7 @@ void op_merge_blocks_with_buf { typedef typename iter_size::type size_type; size_type const key_count = needed_keys_count(n_block_a, n_block_b); - boost::ignore_unused(key_count); + boost::movelib::ignore(key_count); //BOOST_ASSERT(n_block_a || n_block_b); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted_and_unique(key_first, key_first + key_count, key_comp)); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(!n_block_b || n_block_a == count_if_with(key_first, key_first + key_count, key_comp, key_first[n_block_a])); @@ -1277,7 +1276,7 @@ void op_merge_blocks_with_buf RandIt const first_irr2 = first2 + size_type(n_block_left*l_block); bool is_range1_A = true; const size_type len = size_type(l_block * n_block_a + l_block * n_block_b + l_irreg1 + l_irreg2); - boost::ignore_unused(len); + boost::movelib::ignore(len); RandItKeys key_range2(key_first); @@ -1291,11 +1290,11 @@ void op_merge_blocks_with_buf max_check = min_value(max_value(max_check, size_type(next_key_idx+2)), n_block_left); RandIt first_min = first2 + size_type(next_key_idx*l_block); RandIt const last_min = first_min + l_block; - boost::ignore_unused(last_min); + boost::movelib::ignore(last_min); RandIt const last2 = first2 + l_block; bool const buffer_empty = buffer == buffer_end; - boost::ignore_unused(buffer_empty); + boost::movelib::ignore(buffer_empty); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(buffer_empty ? boost::movelib::is_sorted(first1, last1, comp) : boost::movelib::is_sorted(buffer, buffer_end, comp)); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first2, last2, comp)); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(!n_block_left || boost::movelib::is_sorted(first_min, last_min, comp)); @@ -1317,7 +1316,7 @@ void op_merge_blocks_with_buf BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_blocks_w_fwd: ", len); buffer = buffer_end = buf_first; BOOST_ASSERT(buffer_empty || res == last1); - boost::ignore_unused(res); + boost::movelib::ignore(res); //swap_and_update_key(key_next, key_range2, key_mid, first2, last2, first_min); buffer_end = buffer_and_update_key(key_next, key_range2, key_mid, first2, last2, first_min, buffer = buf_first, op); BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_blocks_w_swp: ", len); @@ -1359,7 +1358,7 @@ void op_merge_blocks_with_buf max_check = size_type(max_check - (max_check != 0)); } RandIt res = op(forward_t(), buffer, buffer_end, first1); - boost::ignore_unused(res); + boost::movelib::ignore(res); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first, res, comp)); BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_blocks_w_fwd: ", len); diff --git a/include/boost/move/algo/detail/merge.hpp b/include/boost/move/algo/detail/merge.hpp index f631923..852688b 100644 --- a/include/boost/move/algo/detail/merge.hpp +++ b/include/boost/move/algo/detail/merge.hpp @@ -11,8 +11,6 @@ #ifndef BOOST_MOVE_MERGE_HPP #define BOOST_MOVE_MERGE_HPP -#include -#include #include #include #include @@ -641,7 +639,7 @@ void op_merge_with_right_placed if (r_first == r_last) { InputOutIterator end = op(forward_t(), first, last, dest_first); BOOST_ASSERT(end == r_last); - boost::ignore_unused(end); + boost::movelib::ignore(end); return; } else if (comp(*r_first, *first)) { @@ -678,7 +676,7 @@ void op_merge_with_left_placed if(first == last) { BidirOutIterator res = op(backward_t(), r_first, r_last, dest_last); BOOST_ASSERT(last == res); - boost::ignore_unused(res); + boost::movelib::ignore(res); return; } --r_last; @@ -742,7 +740,7 @@ void uninitialized_merge_with_right_placed d.release(); InputOutIterator end = ::boost::move(first, last, original_r_first); BOOST_ASSERT(end == r_last); - boost::ignore_unused(end); + boost::movelib::ignore(end); return; } else if (comp(*r_first, *first)) { diff --git a/include/boost/move/detail/nsec_clock.hpp b/include/boost/move/detail/nsec_clock.hpp index 21b19cd..4de5c7d 100644 --- a/include/boost/move/detail/nsec_clock.hpp +++ b/include/boost/move/detail/nsec_clock.hpp @@ -44,7 +44,6 @@ #include #include #include -#include namespace boost { namespace move_detail { @@ -55,7 +54,7 @@ struct QPFHolder { boost::winapi::LARGE_INTEGER_ freq; boost::winapi::BOOL_ r = boost::winapi::QueryPerformanceFrequency( &freq ); - boost::ignore_unused(r); + boost::movelib::ignore(r); BOOST_ASSERT(r != 0 && "Boost::Move - get_nanosecs_per_tic Internal Error"); return double(1000000000.0L / freq.QuadPart); diff --git a/include/boost/move/detail/workaround.hpp b/include/boost/move/detail/workaround.hpp index 77e0114..c3570e6 100644 --- a/include/boost/move/detail/workaround.hpp +++ b/include/boost/move/detail/workaround.hpp @@ -68,4 +68,14 @@ #define BOOST_MOVE_FORCEINLINE BOOST_FORCEINLINE #endif +namespace boost { +namespace movelib { + +template +BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&) +{} + +}} //namespace boost::movelib { + #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP + diff --git a/test/copy_elision_test.cpp b/test/copy_elision_test.cpp index 69eb9dd..7836cd8 100644 --- a/test/copy_elision_test.cpp +++ b/test/copy_elision_test.cpp @@ -4,7 +4,6 @@ #include #include -#include #ifdef NO_MOVE # undef BOOST_COPY_ASSIGN_REF @@ -148,7 +147,7 @@ X ternary( bool y ) int main(int argc, char* argv[]) { - ::boost::ignore_unused(argv); + ::boost::movelib::ignore(argv); // Double parens prevent "most vexing parse" CHECK_COPIES( X a(( lvalue() )), 1U, 1U, "Direct initialization from lvalue"); CHECK_COPIES( X a(( rvalue() )), 0U, 1U, "Direct initialization from rvalue"); diff --git a/test/move.cpp b/test/move.cpp index b81dea4..13c2686 100644 --- a/test/move.cpp +++ b/test/move.cpp @@ -10,7 +10,6 @@ // ////////////////////////////////////////////////////////////////////////////// #include -#include #include "../example/movable.hpp" #include "../example/copymovable.hpp" #include @@ -110,40 +109,40 @@ int main() movable m2(boost::move(m)); movable m3(function(movable(boost::move(m2)))); movable m4(function(boost::move(m3))); - ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); + ::boost::movelib::ignore(m);::boost::movelib::ignore(m2);::boost::movelib::ignore(m3);::boost::movelib::ignore(m4); } { movable m; movable m2(boost::move(m)); movable m3(functionr(movable(boost::move(m2)))); movable m4(functionr(boost::move(m3))); - ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); + ::boost::movelib::ignore(m);::boost::movelib::ignore(m2);::boost::movelib::ignore(m3);::boost::movelib::ignore(m4); } { movable m; movable m2(boost::move(m)); movable m3(function2(movable(boost::move(m2)))); movable m4(function2(boost::move(m3))); - ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); + ::boost::movelib::ignore(m);::boost::movelib::ignore(m2);::boost::movelib::ignore(m3);::boost::movelib::ignore(m4); } { movable m; movable m2(boost::move(m)); movable m3(function2r(movable(boost::move(m2)))); movable m4(function2r(boost::move(m3))); - ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); + ::boost::movelib::ignore(m);::boost::movelib::ignore(m2);::boost::movelib::ignore(m3);::boost::movelib::ignore(m4); } { movable m; movable m2(boost::move(m)); movable m3(move_return_function()); - ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3); + ::boost::movelib::ignore(m);::boost::movelib::ignore(m2);::boost::movelib::ignore(m3); } { movable m; movable m2(boost::move(m)); movable m3(move_return_function2()); - ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3); + ::boost::movelib::ignore(m);::boost::movelib::ignore(m2);::boost::movelib::ignore(m3); } { //movable @@ -151,9 +150,9 @@ int main() m = factory_wrapper(factory()); movable&mr(factory_wrapper(factory())); movable&mr2 = factory_wrapper(factory()); - ::boost::ignore_unused(mr); - ::boost::ignore_unused(mr2); - ::boost::ignore_unused(m); + ::boost::movelib::ignore(mr); + ::boost::movelib::ignore(mr2); + ::boost::movelib::ignore(m); } { //copyable @@ -161,9 +160,9 @@ int main() c = factory_wrapper(factory()); copyable&cr(factory_wrapper(factory())); copyable&cr2 = factory_wrapper(factory()); - ::boost::ignore_unused(cr); - ::boost::ignore_unused(cr2); - ::boost::ignore_unused(c); + ::boost::movelib::ignore(cr); + ::boost::movelib::ignore(cr2); + ::boost::movelib::ignore(c); } { @@ -172,9 +171,9 @@ int main() c = factory_wrapper(factory()); copy_movable&cr(factory_wrapper(factory())); copy_movable&cr2 = factory_wrapper(factory()); - ::boost::ignore_unused(cr); - ::boost::ignore_unused(cr2); - ::boost::ignore_unused(c); + ::boost::movelib::ignore(cr); + ::boost::movelib::ignore(cr2); + ::boost::movelib::ignore(c); } return 0; diff --git a/test/unique_ptr_modifiers.cpp b/test/unique_ptr_modifiers.cpp index 05ff3d7..5357328 100644 --- a/test/unique_ptr_modifiers.cpp +++ b/test/unique_ptr_modifiers.cpp @@ -11,7 +11,6 @@ // ////////////////////////////////////////////////////////////////////////////// #include -#include #include #include #include @@ -89,7 +88,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -99,7 +98,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new A); BOOST_TEST(A::count == 1); } @@ -108,7 +107,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(0); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -122,7 +121,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -132,7 +131,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new A[3]); BOOST_TEST(A::count == 3); } @@ -141,7 +140,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(0); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -155,7 +154,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -165,7 +164,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new A[3]); BOOST_TEST(A::count == 3); } @@ -174,7 +173,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(0); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -200,7 +199,7 @@ void test() BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 0); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new B); BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 1); @@ -212,7 +211,7 @@ void test() BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 1); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new B); BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 1); @@ -225,7 +224,7 @@ void test() bml::unique_ptr p(new const A[2]); BOOST_TEST(A::count == 2); const volatile A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new volatile A[3]); BOOST_TEST(A::count == 3); } @@ -234,7 +233,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); const A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new const A[3]); BOOST_TEST(A::count == 3); } @@ -245,7 +244,7 @@ void test() bml::unique_ptr p(new const A[2]); BOOST_TEST(A::count == 2); const volatile A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new volatile A[3]); BOOST_TEST(A::count == 3); } @@ -254,7 +253,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); const A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(new const A[3]); BOOST_TEST(A::count == 3); } diff --git a/test/unique_ptr_nullptr.cpp b/test/unique_ptr_nullptr.cpp index 27876ae..dcd0e53 100644 --- a/test/unique_ptr_nullptr.cpp +++ b/test/unique_ptr_nullptr.cpp @@ -11,7 +11,6 @@ // ////////////////////////////////////////////////////////////////////////////// #include -#include #include #include #include @@ -108,7 +107,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(nullptr); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -118,7 +117,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p = nullptr; BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -144,7 +143,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(nullptr); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -154,7 +153,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p = nullptr; BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -179,7 +178,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p.reset(nullptr); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -189,7 +188,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - ::boost::ignore_unused(i); + ::boost::movelib::ignore(i); p = nullptr; BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0);