diff --git a/example/copymovable.hpp b/example/copymovable.hpp index 173d420..e7f3764 100644 --- a/example/copymovable.hpp +++ b/example/copymovable.hpp @@ -11,8 +11,6 @@ #ifndef BOOST_MOVE_TEST_COPYMOVABLE_HPP #define BOOST_MOVE_TEST_COPYMOVABLE_HPP -#include - //[copy_movable_definition //header file "copymovable.hpp" #include @@ -59,6 +57,4 @@ class non_copy_movable //] -#include - #endif //BOOST_MOVE_TEST_COPYMOVABLE_HPP diff --git a/example/doc_clone_ptr.cpp b/example/doc_clone_ptr.cpp index e0fa73c..c54fd4c 100644 --- a/example/doc_clone_ptr.cpp +++ b/example/doc_clone_ptr.cpp @@ -8,7 +8,6 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include //[clone_ptr_base_derived @@ -153,5 +152,3 @@ int main() //] return 0; } - -#include diff --git a/example/doc_construct_forward.cpp b/example/doc_construct_forward.cpp index 388a97c..b6d64b6 100644 --- a/example/doc_construct_forward.cpp +++ b/example/doc_construct_forward.cpp @@ -9,8 +9,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include - //[construct_forward_example #include #include @@ -105,5 +103,3 @@ int main() return 0; } //] - -#include diff --git a/example/doc_file_descriptor.cpp b/example/doc_file_descriptor.cpp index 0ec3987..1c7f28f 100644 --- a/example/doc_file_descriptor.cpp +++ b/example/doc_file_descriptor.cpp @@ -9,9 +9,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include -#include - //[file_descriptor_def #include @@ -25,8 +22,8 @@ class file_descriptor return 1; } - void operating_system_close_file(int fd) - { (void)fd; assert(fd != 0); } + void operating_system_close_file(int) + {} //-> int os_descr_; @@ -88,5 +85,3 @@ int main() return 0; } //] - -#include diff --git a/example/doc_how_works.cpp b/example/doc_how_works.cpp index ef28be4..361ab88 100644 --- a/example/doc_how_works.cpp +++ b/example/doc_how_works.cpp @@ -20,8 +20,6 @@ int main() #else -#include - //[how_works_example #include #include @@ -58,6 +56,4 @@ int main() } //] -#include - #endif diff --git a/example/doc_move_algorithms.cpp b/example/doc_move_algorithms.cpp index 6fe487a..00cc022 100644 --- a/example/doc_move_algorithms.cpp +++ b/example/doc_move_algorithms.cpp @@ -9,8 +9,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include - //[move_algorithms_example #include "movable.hpp" #include @@ -43,4 +41,3 @@ int main() } //] -#include diff --git a/example/doc_move_inserter.cpp b/example/doc_move_inserter.cpp index c715412..823039f 100644 --- a/example/doc_move_inserter.cpp +++ b/example/doc_move_inserter.cpp @@ -9,8 +9,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include - //[move_inserter_example #include #include "movable.hpp" @@ -48,5 +46,3 @@ int main() return 0; } //] - -#include diff --git a/example/doc_move_iterator.cpp b/example/doc_move_iterator.cpp index 86d3893..0e7cc51 100644 --- a/example/doc_move_iterator.cpp +++ b/example/doc_move_iterator.cpp @@ -8,7 +8,7 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include + //[move_iterator_example #include #include "movable.hpp" @@ -37,5 +37,3 @@ int main() return 0; } //] - -#include diff --git a/example/doc_move_return.cpp b/example/doc_move_return.cpp index 0d5db0f..19ed61e 100644 --- a/example/doc_move_return.cpp +++ b/example/doc_move_return.cpp @@ -9,7 +9,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#include +#include //[move_return_example #include "movable.hpp" @@ -61,10 +61,8 @@ int main() copyable c = lock_wrapper(factory_functor ()); non_copy_movable &mr = lock_wrapper(return_reference ()); //<- - (void)m; (void)cm; (void)c; (void)mr; + boost::ignore_unused(m); boost::ignore_unused(cm); boost::ignore_unused(c); boost::ignore_unused(mr); //-> return 0; } //] - -#include diff --git a/example/doc_template_assign.cpp b/example/doc_template_assign.cpp index e1959a9..2b759d2 100644 --- a/example/doc_template_assign.cpp +++ b/example/doc_template_assign.cpp @@ -9,7 +9,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include #include #include @@ -94,5 +93,3 @@ int main() return 0; } - -#include diff --git a/example/movable.hpp b/example/movable.hpp index 7b1d990..3b2518f 100644 --- a/example/movable.hpp +++ b/example/movable.hpp @@ -11,8 +11,6 @@ #ifndef BOOST_MOVE_TEST_MOVABLE_HPP #define BOOST_MOVE_TEST_MOVABLE_HPP -#include - //[movable_definition //header file "movable.hpp" #include @@ -52,6 +50,4 @@ struct has_nothrow_move } //namespace boost{ //] -#include - #endif //BOOST_MOVE_TEST_MOVABLE_HPP diff --git a/include/boost/move/algo/adaptive_merge.hpp b/include/boost/move/algo/adaptive_merge.hpp index 2169843..9433b6f 100644 --- a/include/boost/move/algo/adaptive_merge.hpp +++ b/include/boost/move/algo/adaptive_merge.hpp @@ -98,16 +98,14 @@ inline void adaptive_merge_final_merge( RandIt first , typename iterator_traits::size_type len2 , typename iterator_traits::size_type collected , typename iterator_traits::size_type l_intbuf - , typename iterator_traits::size_type l_block - , bool use_internal_buf + , typename iterator_traits::size_type //l_block + , bool //use_internal_buf , bool xbuf_used , Compare comp , XBuf & xbuf ) { typedef typename iterator_traits::size_type size_type; - (void)l_block; - (void)use_internal_buf; size_type n_keys = collected-l_intbuf; size_type len = len1+len2; if (!xbuf_used || n_keys) { diff --git a/include/boost/move/algo/adaptive_sort.hpp b/include/boost/move/algo/adaptive_sort.hpp index cdffa2e..4a3b2ac 100644 --- a/include/boost/move/algo/adaptive_sort.hpp +++ b/include/boost/move/algo/adaptive_sort.hpp @@ -14,6 +14,7 @@ #include #include +#include namespace boost { namespace movelib { @@ -165,7 +166,7 @@ void adaptive_sort_combine_blocks , Compare comp , bool merge_left) { - (void)xbuf; + boost::ignore_unused(xbuf); typedef typename iterator_traits::size_type size_type; size_type const l_reg_combined = 2*l_prev_merged; @@ -174,7 +175,7 @@ void adaptive_sort_combine_blocks size_type const n_reg_combined = len/l_reg_combined; RandIt combined_first = first; - (void)l_total_combined; + boost::ignore_unused(l_total_combined); BOOST_ASSERT(l_total_combined <= len); size_type const max_i = 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 60ef24a..2780d20 100644 --- a/include/boost/move/algo/detail/adaptive_sort_merge.hpp +++ b/include/boost/move/algo/detail/adaptive_sort_merge.hpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -312,7 +313,8 @@ void merge_blocks_bufferless , Compare comp) { typedef typename iterator_traits::size_type size_type; - size_type const key_count = needed_keys_count(n_block_a, n_block_b); (void)key_count; + size_type const key_count = needed_keys_count(n_block_a, n_block_b); + ::boost::ignore_unused(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])); @@ -602,7 +604,8 @@ void unstable_sort( RandIt first, RandIt last , Comp comp , XBuf & xbuf) { - heap_sort(first, last, comp);(void)xbuf; + heap_sort(first, last, comp); + ::boost::ignore_unused(xbuf); } template @@ -943,13 +946,15 @@ OutputIt op_merge_blocks_with_irreg max_check = min_value(max_value(max_check, next_key_idx+size_type(2)), n_block_left); RandIt const last_reg = first_reg + l_block; RandIt first_min = first_reg + next_key_idx*l_block; - RandIt const last_min = first_min + l_block; (void)last_min; + RandIt const last_min = first_min + l_block; + boost::ignore_unused(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; (void)orig_dest; + OutputIt orig_dest = dest; + boost::ignore_unused(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)); @@ -995,7 +1000,9 @@ void op_merge_blocks_left , Compare comp, Op op) { typedef typename iterator_traits::size_type size_type; - size_type const key_count = needed_keys_count(n_block_a, n_block_b); (void)key_count; + size_type const key_count = needed_keys_count(n_block_a, n_block_b); + boost::ignore_unused(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])); @@ -1023,7 +1030,9 @@ void op_merge_blocks_left size_type const next_key_idx = find_next_block(key_range2, key_comp, first2, l_block, min_check, max_check, comp); max_check = min_value(max_value(max_check, next_key_idx+size_type(2)), n_block_left); RandIt const first_min = first2 + next_key_idx*l_block; - RandIt const last_min = first_min + l_block; (void)last_min; + RandIt const last_min = first_min + l_block; + + boost::ignore_unused(last_min); RandIt const last2 = first2 + l_block; BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first1, last1, comp)); @@ -1068,7 +1077,8 @@ void op_merge_blocks_left unmerged = op_partial_merge_and_save (buffer, buffer+(last1-first1), first2, last2, first_min, buf_beg, buf_end, comp, op, is_range1_A); } - (void)unmerged; + + boost::ignore_unused(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 @@ -1126,7 +1136,8 @@ void op_merge_blocks_left buffer = op_merge_blocks_with_irreg ( 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);(void)buffer; + buffer = op(forward_t(), first_irr2, last_irr2, buffer); + boost::ignore_unused(buffer); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first-l_block, buffer, comp)); } @@ -1216,7 +1227,8 @@ void op_merge_blocks_with_buf , RandItBuf const buf_first) { typedef typename iterator_traits::size_type size_type; - size_type const key_count = needed_keys_count(n_block_a, n_block_b); (void)key_count; + size_type const key_count = needed_keys_count(n_block_a, n_block_b); + boost::ignore_unused(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])); @@ -1233,7 +1245,8 @@ void op_merge_blocks_with_buf RandIt first2 = last1; RandIt const first_irr2 = first2 + n_block_left*l_block; bool is_range1_A = true; - const size_type len = l_block * n_block_a + l_block * n_block_b + l_irreg1 + l_irreg2; (void)len; + const size_type len = l_block * n_block_a + l_block * n_block_b + l_irreg1 + l_irreg2; + boost::ignore_unused(len); RandItKeys key_range2(key_first); @@ -1246,10 +1259,12 @@ void op_merge_blocks_with_buf size_type const next_key_idx = find_next_block(key_range2, key_comp, first2, l_block, min_check, max_check, comp); max_check = min_value(max_value(max_check, next_key_idx+size_type(2)), n_block_left); RandIt first_min = first2 + next_key_idx*l_block; - RandIt const last_min = first_min + l_block; (void)last_min; + RandIt const last_min = first_min + l_block; + boost::ignore_unused(last_min); RandIt const last2 = first2 + l_block; - bool const buffer_empty = buffer == buffer_end; (void)buffer_empty; + bool const buffer_empty = buffer == buffer_end; + boost::ignore_unused(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)); @@ -1270,7 +1285,8 @@ void op_merge_blocks_with_buf RandIt res = op(forward_t(), buffer, buffer_end, first1); BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_blocks_w_fwd: ", len); buffer = buffer_end = buf_first; - BOOST_ASSERT(buffer_empty || res == last1); (void)res; + BOOST_ASSERT(buffer_empty || res == last1); + boost::ignore_unused(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); @@ -1307,7 +1323,8 @@ void op_merge_blocks_with_buf last1 += l_block; first2 = last2; } - RandIt res = op(forward_t(), buffer, buffer_end, first1); (void)res; + RandIt res = op(forward_t(), buffer, buffer_end, first1); + boost::ignore_unused(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 58df061..a542c5c 100644 --- a/include/boost/move/algo/detail/merge.hpp +++ b/include/boost/move/algo/detail/merge.hpp @@ -11,6 +11,7 @@ #ifndef BOOST_MOVE_MERGE_HPP #define BOOST_MOVE_MERGE_HPP +#include #include #include #include @@ -680,7 +681,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); - (void)end; + boost::ignore_unused(end); return; } else if (comp(*r_first, *first)) { @@ -717,7 +718,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); - (void)res; + boost::ignore_unused(res); return; } --r_last; @@ -781,7 +782,7 @@ void uninitialized_merge_with_right_placed d.release(); InputOutIterator end = ::boost::move(first, last, original_r_first); BOOST_ASSERT(end == r_last); - (void)end; + boost::ignore_unused(end); return; } else if (comp(*r_first, *first)) { @@ -800,51 +801,6 @@ void uninitialized_merge_with_right_placed merge_with_right_placed(first, last, original_r_first, r_first, r_last, comp); } -/* -// [r_first, r_last) are already in the right part of the destination range. -// [dest_first, r_first) is uninitialized memory -template -void uninitialized_merge_with_left_placed - ( BidirOutIterator dest_first, BidirOutIterator r_first, BidirOutIterator r_last - , BidirIterator first, BidirIterator last - , Compare comp) -{ - BOOST_ASSERT((last - first) == (r_last - r_first)); - typedef typename iterator_traits::value_type value_type; - BidirOutIterator const original_r_last = r_last; - - destruct_n d(&*dest_last); - - while ( first != last && dest_first != original_r_first ) { - if (r_first == r_last) { - for(; dest_first != original_r_first; ++dest_first, ++first){ - ::new(&*dest_first) value_type(::boost::move(*first)); - d.incr(); - } - d.release(); - BidirOutIterator end = ::boost::move(first, last, original_r_first); - BOOST_ASSERT(end == r_last); - (void)end; - return; - } - else if (comp(*r_first, *first)) { - ::new(&*dest_first) value_type(::boost::move(*r_first)); - d.incr(); - ++r_first; - } - else { - ::new(&*dest_first) value_type(::boost::move(*first)); - d.incr(); - ++first; - } - ++dest_first; - } - d.release(); - merge_with_right_placed(first, last, original_r_first, r_first, r_last, comp); -} -*/ - - /// This is a helper function for the merge routines. template BidirectionalIterator1 diff --git a/test/adl_move_swap.cpp b/test/adl_move_swap.cpp index 200c6cb..18926a7 100644 --- a/test/adl_move_swap.cpp +++ b/test/adl_move_swap.cpp @@ -8,7 +8,6 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include #include #include @@ -166,4 +165,3 @@ int main() } return ::boost::report_errors(); } -#include diff --git a/test/back_move_inserter.cpp b/test/back_move_inserter.cpp index 6fc4829..3e7c239 100644 --- a/test/back_move_inserter.cpp +++ b/test/back_move_inserter.cpp @@ -8,7 +8,7 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include + // move #include #include @@ -76,5 +76,3 @@ int main() } return 0; } - -#include diff --git a/test/construct_forward.cpp b/test/construct_forward.cpp index 87c9a80..ea6aaf8 100644 --- a/test/construct_forward.cpp +++ b/test/construct_forward.cpp @@ -8,8 +8,9 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include + #include + #include #include "../example/movable.hpp" #include "../example/copymovable.hpp" @@ -23,36 +24,36 @@ class non_movable }; template -void catch_test(BOOST_RV_REF(MaybeRvalue) x +void catch_test(BOOST_RV_REF(MaybeRvalue) #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES ,typename ::boost::enable_if< ::boost::has_move_emulation_enabled >::type* = 0 #endif //BOOST_NO_CXX11_RVALUE_REFERENCES ) -{ (void)x;} +{} template -void catch_test(BOOST_COPY_ASSIGN_REF(MaybeRvalue) x +void catch_test(BOOST_COPY_ASSIGN_REF(MaybeRvalue) #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES ,typename ::boost::enable_if< ::boost::has_move_emulation_enabled >::type* = 0 #endif //BOOST_NO_CXX11_RVALUE_REFERENCES ) -{ (void)x;} +{} template -void catch_test(MaybeRvalue &x +void catch_test(MaybeRvalue & #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES ,typename ::boost::enable_if< ::boost::has_move_emulation_enabled >::type* = 0 #endif //BOOST_NO_CXX11_RVALUE_REFERENCES ) -{ (void)x;} +{} #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES template -void catch_test(const MaybeRvalue& x +void catch_test(const MaybeRvalue& ,typename ::boost::disable_if< ::boost::has_move_emulation_enabled >::type* = 0 ) -{ (void)x;} +{} #endif //BOOST_NO_CXX11_RVALUE_REFERENCES movable create_movable() @@ -113,5 +114,3 @@ int main() forward_test(); return 0; } - -#include diff --git a/test/copy_elision_test.cpp b/test/copy_elision_test.cpp index 39123e1..69eb9dd 100644 --- a/test/copy_elision_test.cpp +++ b/test/copy_elision_test.cpp @@ -2,9 +2,9 @@ // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include #include #include +#include #ifdef NO_MOVE # undef BOOST_COPY_ASSIGN_REF @@ -148,7 +148,7 @@ X ternary( bool y ) int main(int argc, char* argv[]) { - (void)argv; + ::boost::ignore_unused(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"); @@ -173,5 +173,3 @@ int main(int argc, char* argv[]) CHECK_COPIES( X a = ternary( argc != 1000 ), 0U, 2U, "Return result of ternary operation again" ); return boost::report_errors(); } - -#include diff --git a/test/copy_move_optimization.cpp b/test/copy_move_optimization.cpp index 06d1847..6fcebb2 100644 --- a/test/copy_move_optimization.cpp +++ b/test/copy_move_optimization.cpp @@ -8,7 +8,7 @@ //Optimization: //Since RVO is better than move-construction, //avoid copy constructor overloading. -#include + #include #include @@ -103,5 +103,3 @@ int main() //1 rv & constructor: move constructor //1 const rv & constructor: copy constructor //1 T & constructor: copy constructor - -#include diff --git a/test/move.cpp b/test/move.cpp index 2d40ec8..b81dea4 100644 --- a/test/move.cpp +++ b/test/move.cpp @@ -9,8 +9,8 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include #include +#include #include "../example/movable.hpp" #include "../example/copymovable.hpp" #include @@ -110,40 +110,40 @@ int main() movable m2(boost::move(m)); movable m3(function(movable(boost::move(m2)))); movable m4(function(boost::move(m3))); - (void)m;(void)m2;(void)m3;(void)m4; + ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); } { movable m; movable m2(boost::move(m)); movable m3(functionr(movable(boost::move(m2)))); movable m4(functionr(boost::move(m3))); - (void)m;(void)m2;(void)m3;(void)m4; + ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); } { movable m; movable m2(boost::move(m)); movable m3(function2(movable(boost::move(m2)))); movable m4(function2(boost::move(m3))); - (void)m;(void)m2;(void)m3;(void)m4; + ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); } { movable m; movable m2(boost::move(m)); movable m3(function2r(movable(boost::move(m2)))); movable m4(function2r(boost::move(m3))); - (void)m;(void)m2;(void)m3;(void)m4; + ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3);::boost::ignore_unused(m4); } { movable m; movable m2(boost::move(m)); movable m3(move_return_function()); - (void)m;(void)m2;(void)m3; + ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3); } { movable m; movable m2(boost::move(m)); movable m3(move_return_function2()); - (void)m;(void)m2;(void)m3; + ::boost::ignore_unused(m);::boost::ignore_unused(m2);::boost::ignore_unused(m3); } { //movable @@ -151,9 +151,9 @@ int main() m = factory_wrapper(factory()); movable&mr(factory_wrapper(factory())); movable&mr2 = factory_wrapper(factory()); - (void)mr; - (void)mr2; - (void)m; + ::boost::ignore_unused(mr); + ::boost::ignore_unused(mr2); + ::boost::ignore_unused(m); } { //copyable @@ -161,9 +161,9 @@ int main() c = factory_wrapper(factory()); copyable&cr(factory_wrapper(factory())); copyable&cr2 = factory_wrapper(factory()); - (void)cr; - (void)cr2; - (void)c; + ::boost::ignore_unused(cr); + ::boost::ignore_unused(cr2); + ::boost::ignore_unused(c); } { @@ -172,12 +172,10 @@ int main() c = factory_wrapper(factory()); copy_movable&cr(factory_wrapper(factory())); copy_movable&cr2 = factory_wrapper(factory()); - (void)cr; - (void)cr2; - (void)c; + ::boost::ignore_unused(cr); + ::boost::ignore_unused(cr2); + ::boost::ignore_unused(c); } return 0; } - -#include diff --git a/test/move_algorithm.cpp b/test/move_algorithm.cpp index 2178328..6c42756 100644 --- a/test/move_algorithm.cpp +++ b/test/move_algorithm.cpp @@ -8,7 +8,7 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include + #include #include #include "../example/movable.hpp" @@ -54,5 +54,3 @@ int main() return 0; } - -#include diff --git a/test/move_if_noexcept.cpp b/test/move_if_noexcept.cpp index a03a821..9c9faff 100644 --- a/test/move_if_noexcept.cpp +++ b/test/move_if_noexcept.cpp @@ -9,7 +9,7 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include + #include #include #include "../example/movable.hpp" @@ -226,5 +226,3 @@ int main() return boost::report_errors(); } - -#include diff --git a/test/move_iterator.cpp b/test/move_iterator.cpp index fded99a..5e43889 100644 --- a/test/move_iterator.cpp +++ b/test/move_iterator.cpp @@ -8,7 +8,7 @@ // See http://www.boost.org/libs/move for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include + #include #include #include @@ -40,5 +40,3 @@ int main() return ::boost::report_errors(); } - -#include diff --git a/test/unique_ptr_modifiers.cpp b/test/unique_ptr_modifiers.cpp index 376c104..05ff3d7 100644 --- a/test/unique_ptr_modifiers.cpp +++ b/test/unique_ptr_modifiers.cpp @@ -11,6 +11,7 @@ // ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -88,7 +89,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -98,7 +99,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new A); BOOST_TEST(A::count == 1); } @@ -107,7 +108,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(0); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -121,7 +122,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -131,7 +132,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new A[3]); BOOST_TEST(A::count == 3); } @@ -140,7 +141,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(0); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -154,7 +155,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -164,7 +165,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new A[3]); BOOST_TEST(A::count == 3); } @@ -173,7 +174,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(0); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -199,7 +200,7 @@ void test() BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 0); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new B); BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 1); @@ -211,7 +212,7 @@ void test() BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 1); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new B); BOOST_TEST(A::count == 1); BOOST_TEST(B::count == 1); @@ -224,7 +225,7 @@ void test() bml::unique_ptr p(new const A[2]); BOOST_TEST(A::count == 2); const volatile A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new volatile A[3]); BOOST_TEST(A::count == 3); } @@ -233,7 +234,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); const A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new const A[3]); BOOST_TEST(A::count == 3); } @@ -244,7 +245,7 @@ void test() bml::unique_ptr p(new const A[2]); BOOST_TEST(A::count == 2); const volatile A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(new volatile A[3]); BOOST_TEST(A::count == 3); } @@ -253,7 +254,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); const A* i = p.get(); - (void)i; + ::boost::ignore_unused(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 555fcc2..27876ae 100644 --- a/test/unique_ptr_nullptr.cpp +++ b/test/unique_ptr_nullptr.cpp @@ -11,6 +11,7 @@ // ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -107,7 +108,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(nullptr); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -117,7 +118,7 @@ void test() bml::unique_ptr p(new A); BOOST_TEST(A::count == 1); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p = nullptr; BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -143,7 +144,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(nullptr); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -153,7 +154,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p = nullptr; BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -178,7 +179,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p.reset(nullptr); BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0); @@ -188,7 +189,7 @@ void test() bml::unique_ptr p(new A[2]); BOOST_TEST(A::count == 2); A* i = p.get(); - (void)i; + ::boost::ignore_unused(i); p = nullptr; BOOST_TEST(A::count == 0); BOOST_TEST(p.get() == 0);