From 9cbef2df943cc6a354da28f2de71fd57abfaf637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Thu, 19 Jan 2023 00:09:49 +0100 Subject: [PATCH] Reduce Boost.Move dependencies to only Boost.Config --- include/boost/move/algo/adaptive_merge.hpp | 7 +- include/boost/move/algo/adaptive_sort.hpp | 33 ++++---- .../move/algo/detail/adaptive_sort_merge.hpp | 44 +++++------ include/boost/move/algo/detail/basic_op.hpp | 1 + include/boost/move/algo/detail/heap_sort.hpp | 3 +- include/boost/move/algo/detail/merge.hpp | 22 +++--- include/boost/move/algo/predicate.hpp | 2 +- include/boost/move/default_delete.hpp | 11 ++- include/boost/move/detail/nsec_clock.hpp | 76 +++++++++++++++---- include/boost/move/detail/type_traits.hpp | 11 ++- include/boost/move/detail/workaround.hpp | 27 +++++++ include/boost/move/unique_ptr.hpp | 35 +++++---- include/boost/move/utility_core.hpp | 5 +- test/bench_merge.cpp | 2 +- test/bench_sort.cpp | 2 +- test/move.cpp | 13 ++-- test/move_if_noexcept.cpp | 1 - test/order_type.hpp | 4 +- test/type_traits.cpp | 33 ++++---- test/unique_ptr_assign.cpp | 1 - test/unique_ptr_ctordtor.cpp | 1 - test/unique_ptr_modifiers.cpp | 1 - test/unique_ptr_movector.cpp | 3 +- test/unique_ptr_nullptr.cpp | 1 - test/unique_ptr_observers.cpp | 1 - test/unique_ptr_test_utils_beg.hpp | 3 +- test/unique_ptr_types.cpp | 43 +++++------ 27 files changed, 226 insertions(+), 160 deletions(-) diff --git a/include/boost/move/algo/adaptive_merge.hpp b/include/boost/move/algo/adaptive_merge.hpp index 9f39920..bba41bd 100644 --- a/include/boost/move/algo/adaptive_merge.hpp +++ b/include/boost/move/algo/adaptive_merge.hpp @@ -14,6 +14,7 @@ #include #include +#include #if defined(BOOST_CLANG) || (defined(BOOST_GCC) && (BOOST_GCC >= 40600)) #pragma GCC diagnostic push @@ -53,7 +54,7 @@ inline void adaptive_merge_combine_blocks( RandIt first if(xbuf.size() < l_block){ xbuf.initialize_until(l_block, *first); } - BOOST_ASSERT(xbuf.size() >= l_block); + assert(xbuf.size() >= l_block); size_type n_block_a, n_block_b, l_irreg1, l_irreg2; combine_params( keys, comp, l_combine , l_combine1, l_block, xbuf @@ -91,7 +92,7 @@ inline void adaptive_merge_combine_blocks( RandIt first , l_combine1, l_block, xbuf , n_block_a, n_block_b, l_irreg1, l_irreg2, true); //Outputs BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" A combine: ", len); - BOOST_ASSERT(xbuf.size() >= l_block); + assert(xbuf.size() >= l_block); op_merge_blocks_with_buf (uint_keys, less(), first, l_block, l_irreg1, n_block_a, n_block_b, l_irreg2, comp, move_op(), xbuf.data()); xbuf.clear(); @@ -163,7 +164,7 @@ inline SizeType adaptive_merge_n_keys_intbuf(SizeType &rl_block, SizeType len1, //This is the minimum number of keys to implement the ideal algorithm size_type n_keys = adaptive_merge_n_keys_without_external_keys(l_block, len1, len2, l_intbuf); - BOOST_ASSERT(n_keys >= ((len1-l_intbuf-n_keys)/l_block + len2/l_block)); + assert(n_keys >= ((len1-l_intbuf-n_keys)/l_block + len2/l_block)); if(xbuf.template supports_aligned_trailing ( l_block diff --git a/include/boost/move/algo/adaptive_sort.hpp b/include/boost/move/algo/adaptive_sort.hpp index 30fd0e7..b2ade8b 100644 --- a/include/boost/move/algo/adaptive_sort.hpp +++ b/include/boost/move/algo/adaptive_sort.hpp @@ -15,6 +15,7 @@ #include #include +#include #if defined(BOOST_CLANG) || (defined(BOOST_GCC) && (BOOST_GCC >= 40600)) #pragma GCC diagnostic push @@ -92,8 +93,8 @@ typename iter_size::type , Compare comp) { typedef typename iter_size::type size_type; - BOOST_ASSERT(l_build_buf <= len); - BOOST_ASSERT(0 == ((l_build_buf / l_base)&(l_build_buf/l_base-1))); + assert(l_build_buf <= len); + assert(0 == ((l_build_buf / l_base)&(l_build_buf/l_base-1))); //Place the start pointer after the buffer RandIt first_block = first + l_build_buf; @@ -104,7 +105,7 @@ typename iter_size::type ////////////////////////////////// size_type l_merged = 0u; - BOOST_ASSERT(l_build_buf); + assert(l_build_buf); //If there is no enough buffer for the insertion sort step, just avoid the external buffer size_type kbuf = min_value(l_build_buf, size_type(xbuf.capacity())); kbuf = kbuf < l_base ? 0 : kbuf; @@ -135,7 +136,7 @@ typename iter_size::type l_merged = op_merge_left_step_multiple (first_block-l_merged, elements_in_blocks, l_merged, l_build_buf, size_type(l_build_buf - l_merged), comp, swap_op()); - BOOST_ASSERT(l_merged == l_build_buf); + assert(l_merged == l_build_buf); ////////////////////////////////// // Start of merge to right step @@ -181,7 +182,7 @@ void adaptive_sort_combine_blocks RandIt combined_first = first; boost::movelib::ignore(l_total_combined); - BOOST_ASSERT(l_total_combined <= len); + assert(l_total_combined <= len); size_type const max_i = size_type(n_reg_combined + (l_irreg_combined != 0)); @@ -277,9 +278,9 @@ bool adaptive_sort_combine_all_blocks //Otherwise, just give up and and use all keys to merge using rotations (use_internal_buf = false) bool use_internal_buf = false; size_type const l_block = lblock_for_combine(l_intbuf, n_keys, size_type(2*l_merged), use_internal_buf); - BOOST_ASSERT(!l_intbuf || (l_block == l_intbuf)); - BOOST_ASSERT(n == 0 || (!use_internal_buf || prev_use_internal_buf) ); - BOOST_ASSERT(n == 0 || (!use_internal_buf || l_prev_block == l_block) ); + assert(!l_intbuf || (l_block == l_intbuf)); + assert(n == 0 || (!use_internal_buf || prev_use_internal_buf) ); + assert(n == 0 || (!use_internal_buf || l_prev_block == l_block) ); bool const is_merge_left = (n&1) == 0; size_type const l_total_combined = calculate_total_combined(l_data, l_merged); @@ -331,7 +332,7 @@ bool adaptive_sort_combine_all_blocks l_prev_block = l_block; prev_use_internal_buf = use_internal_buf; } - BOOST_ASSERT(l_prev_total_combined == l_data); + assert(l_prev_total_combined == l_data); bool const buffer_right = prev_use_internal_buf && prev_merge_left; l_intbuf = prev_use_internal_buf ? l_prev_block : 0u; @@ -358,7 +359,7 @@ void adaptive_sort_final_merge( bool buffer_right , XBuf & xbuf , Compare comp) { - //BOOST_ASSERT(n_keys || xbuf.size() == l_intbuf); + //assert(n_keys || xbuf.size() == l_intbuf); xbuf.clear(); typedef typename iter_size::type size_type; @@ -422,7 +423,7 @@ bool adaptive_sort_build_params --n_min_ideal_keys; } ++n_min_ideal_keys; - BOOST_ASSERT(n_min_ideal_keys <= l_intbuf); + assert(n_min_ideal_keys <= l_intbuf); if(xbuf.template supports_aligned_trailing (l_intbuf, size_type((size_type(len-l_intbuf)-1u)/l_intbuf+1u))){ @@ -459,7 +460,7 @@ bool adaptive_sort_build_params //If collected keys are not enough, try to fix n_keys and l_intbuf. If no fix //is possible (due to very low unique keys), then go to a slow sort based on rotations. else{ - BOOST_ASSERT(collected < (n_min_ideal_keys+l_intbuf)); + assert(collected < (n_min_ideal_keys+l_intbuf)); if(collected < 4){ //No combination possible with less that 4 keys return false; } @@ -475,7 +476,7 @@ bool adaptive_sort_build_params l_intbuf = 0; l_build_buf = n_keys; } - BOOST_ASSERT((n_keys+l_intbuf) >= l_build_buf); + assert((n_keys+l_intbuf) >= l_build_buf); } return true; @@ -556,7 +557,7 @@ void adaptive_sort_impl } else{ //Make sure it is at least four - BOOST_STATIC_ASSERT(AdaptiveSortInsertionSortThreshold >= 4); + BOOST_MOVE_STATIC_ASSERT(AdaptiveSortInsertionSortThreshold >= 4); size_type l_base = 0; size_type l_intbuf = 0; @@ -569,12 +570,12 @@ void adaptive_sort_impl stable_sort(first, first+len, comp, xbuf); } else{ - BOOST_ASSERT(l_build_buf); + assert(l_build_buf); //Otherwise, continue the adaptive_sort BOOST_MOVE_ADAPTIVE_SORT_PRINT_L1("\n After collect_unique: ", len); size_type const n_key_plus_buf = size_type(l_intbuf+n_keys); //l_build_buf is always power of two if l_intbuf is zero - BOOST_ASSERT(l_intbuf || (0 == (l_build_buf & (l_build_buf-1)))); + assert(l_intbuf || (0 == (l_build_buf & (l_build_buf-1)))); //Classic merge sort until internal buffer and xbuf are exhausted size_type const l_merged = adaptive_sort_build_blocks diff --git a/include/boost/move/algo/detail/adaptive_sort_merge.hpp b/include/boost/move/algo/detail/adaptive_sort_merge.hpp index fcd579a..79c4699 100644 --- a/include/boost/move/algo/detail/adaptive_sort_merge.hpp +++ b/include/boost/move/algo/detail/adaptive_sort_merge.hpp @@ -53,7 +53,7 @@ #include #include #include -#include +#include #include #include @@ -88,7 +88,7 @@ #endif #ifdef BOOST_MOVE_ADAPTIVE_SORT_INVARIANTS - #define BOOST_MOVE_ADAPTIVE_SORT_INVARIANT BOOST_ASSERT + #define BOOST_MOVE_ADAPTIVE_SORT_INVARIANT assert #else #define BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(L) #endif @@ -117,7 +117,7 @@ namespace detail_adaptive { static const std::size_t AdaptiveSortInsertionSortThreshold = 16; //static const std::size_t AdaptiveSortInsertionSortThreshold = 4; -BOOST_STATIC_ASSERT((AdaptiveSortInsertionSortThreshold&(AdaptiveSortInsertionSortThreshold-1)) == 0); +BOOST_MOVE_STATIC_ASSERT((AdaptiveSortInsertionSortThreshold&(AdaptiveSortInsertionSortThreshold-1)) == 0); #if defined BOOST_HAS_INTPTR_T typedef ::boost::uintptr_t uintptr_t; @@ -290,7 +290,7 @@ typename iter_size::type typedef typename iter_size::type size_type; typedef typename iterator_traits::value_type value_type; typedef typename iterator_traits::value_type key_type; - BOOST_ASSERT(ix_first_block <= ix_last_block); + assert(ix_first_block <= ix_last_block); size_type ix_min_block = 0u; for (size_type szt_i = ix_first_block; szt_i < ix_last_block; ++szt_i) { const value_type &min_val = first[size_type(ix_min_block*l_block)]; @@ -323,7 +323,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::movelib::ignore(key_count); - //BOOST_ASSERT(n_block_a || n_block_b); + //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])); @@ -575,7 +575,7 @@ template Unsigned lblock_for_combine (Unsigned const l_block, Unsigned const n_keys, Unsigned const l_data, bool &use_buf) { - BOOST_ASSERT(l_data > 1); + assert(l_data > 1); //We need to guarantee lblock >= l_merged/(n_keys/2) keys for the combination. //We have at least 4 keys guaranteed (which are the minimum to merge 2 ranges) @@ -586,8 +586,8 @@ Unsigned lblock_for_combine if(!l_block){ //If l_block == 0 then n_keys is power of two //(guaranteed by build_params(...)) - BOOST_ASSERT(n_keys >= 4); - //BOOST_ASSERT(0 == (n_keys &(n_keys-1))); + assert(n_keys >= 4); + //assert(0 == (n_keys &(n_keys-1))); //See if half keys are at least 4 and if half keys fulfill Unsigned const new_buf = n_keys/2; @@ -635,7 +635,7 @@ void stable_merge , Compare comp , XBuf &xbuf) { - BOOST_ASSERT(xbuf.empty()); + assert(xbuf.empty()); typedef typename iter_size::type size_type; size_type const len1 = size_type(middle-first); size_type const len2 = size_type(last-middle); @@ -657,7 +657,7 @@ void initialize_keys( RandIt first, RandIt last , XBuf & xbuf) { unstable_sort(first, last, comp, xbuf); - BOOST_ASSERT(boost::movelib::is_sorted_and_unique(first, last, comp)); + assert(boost::movelib::is_sorted_and_unique(first, last, comp)); } template @@ -711,11 +711,11 @@ void combine_params //Initial parameters for selection sort blocks l_irreg1 = size_type(l_prev_merged%l_block); l_irreg2 = size_type((l_combined-l_irreg1)%l_block); - BOOST_ASSERT(((l_combined-l_irreg1-l_irreg2)%l_block) == 0); + assert(((l_combined-l_irreg1-l_irreg2)%l_block) == 0); size_type const n_reg_block = size_type((l_combined-l_irreg1-l_irreg2)/l_block); n_block_a = l_prev_merged/l_block; n_block_b = size_type(n_reg_block - n_block_a); - BOOST_ASSERT(n_reg_block>=n_block_a); + assert(n_reg_block>=n_block_a); //Key initialization if (do_initialize_keys) { @@ -906,7 +906,7 @@ RandIt op_partial_merge_and_save_impl first1 = last1; } else{ - BOOST_ASSERT((last1-first1) == (buf_last1 - buf_first1)); + assert((last1-first1) == (buf_last1 - buf_first1)); } //Now merge from buffer @@ -1028,7 +1028,7 @@ void op_merge_blocks_left size_type const key_count = needed_keys_count(n_block_a, n_block_b); boost::movelib::ignore(key_count); -// BOOST_ASSERT(n_block_a || n_block_b); +// 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])); @@ -1079,7 +1079,7 @@ void op_merge_blocks_left (!is_buffer_middle && size_type(first1-buffer) == l_block && first2 == last1)); if(is_range1_A == is_range2_A){ - BOOST_ASSERT((first1 == last1) || !comp(*first_min, last1[typename iterator_traits::difference_type(-1)])); + assert((first1 == last1) || !comp(*first_min, last1[typename iterator_traits::difference_type(-1)])); if(!is_buffer_middle){ buffer = op(forward_t(), first1, last1, buffer); } @@ -1132,7 +1132,7 @@ void op_merge_blocks_left } BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(!n_block_b || n_block_a == count_if_with(key_first, key_range2 + n_block_left, key_comp, *key_mid)); - BOOST_ASSERT(!n_block_b_left); + assert(!n_block_b_left); //////////////////////////////////////////////////////////////////////////// //Process remaining range 1 left before the irregular B block @@ -1259,7 +1259,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::movelib::ignore(key_count); - //BOOST_ASSERT(n_block_a || n_block_b); + //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])); @@ -1315,7 +1315,7 @@ 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); + assert(buffer_empty || res == last1); 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); @@ -1329,7 +1329,7 @@ void op_merge_blocks_with_buf RandIt const unmerged = op_partial_merge_and_save(first1, last1, first2, last2, first_min, buffer, buffer_end, comp, op, is_range1_A); BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_blocks_w_mrs: ", len); bool const is_range_1_empty = buffer == buffer_end; - BOOST_ASSERT(is_range_1_empty || (buffer_end-buffer) == (last1+l_block-unmerged)); + assert(is_range_1_empty || (buffer_end-buffer) == (last1+l_block-unmerged)); if(is_range_1_empty){ buffer = buffer_end = buf_first; first_min = last_min - (last2 - first2); @@ -1348,7 +1348,7 @@ void op_merge_blocks_with_buf first1 = unmerged; BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first, unmerged, comp)); } - BOOST_ASSERT( (is_range2_A && n_block_a_left) || (!is_range2_A && n_block_b_left)); + assert( (is_range2_A && n_block_a_left) || (!is_range2_A && n_block_b_left)); is_range2_A ? --n_block_a_left : --n_block_b_left; last1 += l_block; first2 = last2; @@ -1381,7 +1381,7 @@ void op_merge_blocks_with_buf BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_blocks_w_irg: ", len); buffer_end = rbuf_beg.base(); - BOOST_ASSERT((dest-last1) == (buffer_end-buffer)); + assert((dest-last1) == (buffer_end-buffer)); op_merge_with_left_placed(is_range1_A ? first1 : last1, last1, dest, buffer, buffer_end, comp, op); BOOST_MOVE_ADAPTIVE_SORT_PRINT_L2(" merge_with_left_plc:", len); BOOST_MOVE_ADAPTIVE_SORT_INVARIANT(boost::movelib::is_sorted(first, last_irr2, comp)); @@ -1429,7 +1429,7 @@ void op_merge_right_step_once typedef typename iter_size::type size_type; size_type restk = size_type(elements_in_blocks%(2*l_build_buf)); size_type p = size_type(elements_in_blocks - restk); - BOOST_ASSERT(0 == (p%(2*l_build_buf))); + assert(0 == (p%(2*l_build_buf))); if(restk <= l_build_buf){ op(backward_t(),first_block+p, first_block+p+restk, first_block+p+restk+l_build_buf); diff --git a/include/boost/move/algo/detail/basic_op.hpp b/include/boost/move/algo/detail/basic_op.hpp index ea5faf0..144280b 100644 --- a/include/boost/move/algo/detail/basic_op.hpp +++ b/include/boost/move/algo/detail/basic_op.hpp @@ -22,6 +22,7 @@ #include #include #include +#include namespace boost { namespace movelib { diff --git a/include/boost/move/algo/detail/heap_sort.hpp b/include/boost/move/algo/detail/heap_sort.hpp index 871cdd0..60db353 100644 --- a/include/boost/move/algo/detail/heap_sort.hpp +++ b/include/boost/move/algo/detail/heap_sort.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #if defined(BOOST_CLANG) || (defined(BOOST_GCC) && (BOOST_GCC >= 40600)) #pragma GCC diagnostic push @@ -100,7 +101,7 @@ class heap_sort_helper { make_heap(first, last, comp); sort_heap(first, last, comp); - BOOST_ASSERT(boost::movelib::is_sorted(first, last, comp)); + assert(boost::movelib::is_sorted(first, last, comp)); } }; diff --git a/include/boost/move/algo/detail/merge.hpp b/include/boost/move/algo/detail/merge.hpp index 933aa31..ad26004 100644 --- a/include/boost/move/algo/detail/merge.hpp +++ b/include/boost/move/algo/detail/merge.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #if defined(BOOST_CLANG) || (defined(BOOST_GCC) && (BOOST_GCC >= 40600)) @@ -73,7 +73,7 @@ class adaptive_xbuf template void push_back(RandIt first, size_type n) { - BOOST_ASSERT(m_capacity - m_size >= n); + assert(m_capacity - m_size >= n); boost::uninitialized_move(first, first+n, m_ptr+m_size); m_size += n; } @@ -81,7 +81,7 @@ class adaptive_xbuf template iterator add(RandIt it) { - BOOST_ASSERT(m_size < m_capacity); + assert(m_size < m_capacity); RandRawIt p_ret = m_ptr + m_size; ::new(&*p_ret) T(::boost::move(*it)); ++m_size; @@ -119,7 +119,7 @@ class adaptive_xbuf void initialize_until(size_type const sz, T &t) { - BOOST_ASSERT(m_size < m_capacity); + assert(m_size < m_capacity); if(m_size < sz){ BOOST_MOVE_TRY { @@ -232,7 +232,7 @@ class range_xbuf template void move_assign(RandIt first, size_type n) { - BOOST_ASSERT(size_type(n) <= size_type(m_cap-m_first)); + assert(size_type(n) <= size_type(m_cap-m_first)); typedef typename iter_difference::type d_type; m_last = Op()(forward_t(), first, first+d_type(n), m_first); } @@ -634,11 +634,11 @@ void op_merge_with_right_placed , InputOutIterator dest_first, InputOutIterator r_first, InputOutIterator r_last , Compare comp, Op op) { - BOOST_ASSERT((last - first) == (r_first - dest_first)); + assert((last - first) == (r_first - dest_first)); while ( first != last ) { if (r_first == r_last) { InputOutIterator end = op(forward_t(), first, last, dest_first); - BOOST_ASSERT(end == r_last); + assert(end == r_last); boost::movelib::ignore(end); return; } @@ -671,11 +671,11 @@ void op_merge_with_left_placed , BidirIterator const r_first, BidirIterator r_last , Compare comp, Op op) { - BOOST_ASSERT((dest_last - last) == (r_last - r_first)); + assert((dest_last - last) == (r_last - r_first)); while( r_first != r_last ) { if(first == last) { BidirOutIterator res = op(backward_t(), r_first, r_last, dest_last); - BOOST_ASSERT(last == res); + assert(last == res); boost::movelib::ignore(res); return; } @@ -725,7 +725,7 @@ void uninitialized_merge_with_right_placed , InputOutIterator dest_first, InputOutIterator r_first, InputOutIterator r_last , Compare comp) { - BOOST_ASSERT((last - first) == (r_first - dest_first)); + assert((last - first) == (r_first - dest_first)); typedef typename iterator_traits::value_type value_type; InputOutIterator const original_r_first = r_first; @@ -739,7 +739,7 @@ void uninitialized_merge_with_right_placed } d.release(); InputOutIterator end = ::boost::move(first, last, original_r_first); - BOOST_ASSERT(end == r_last); + assert(end == r_last); boost::movelib::ignore(end); return; } diff --git a/include/boost/move/algo/predicate.hpp b/include/boost/move/algo/predicate.hpp index 18dc4ee..58a4d62 100644 --- a/include/boost/move/algo/predicate.hpp +++ b/include/boost/move/algo/predicate.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include namespace boost { namespace movelib { diff --git a/include/boost/move/default_delete.hpp b/include/boost/move/default_delete.hpp index 275794e..2b91dcd 100644 --- a/include/boost/move/default_delete.hpp +++ b/include/boost/move/default_delete.hpp @@ -23,7 +23,6 @@ #include #include #include -#include #include //For std::size_t,std::nullptr_t @@ -190,7 +189,7 @@ struct default_delete { //If T is not an array type, U derives from T //and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor::value )); + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor::value )); } //! Effects: Constructs a default_delete object from another default_delete object. @@ -205,7 +204,7 @@ struct default_delete { //If T is not an array type, U derives from T //and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor::value )); + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor::value )); return *this; } @@ -222,10 +221,10 @@ struct default_delete operator()(U* ptr) const BOOST_NOEXCEPT { //U must be a complete type - BOOST_STATIC_ASSERT(sizeof(U) > 0); + BOOST_MOVE_STATIC_ASSERT(sizeof(U) > 0); //If T is not an array type, U derives from T //and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor::value )); + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor::value )); element_type * const p = static_cast(ptr); move_upd::call_delete(p, move_upd::is_array_del::value>()); } @@ -233,7 +232,7 @@ struct default_delete //! Effects: Same as (*this)(static_cast(nullptr)). //! void operator()(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) const BOOST_NOEXCEPT - { BOOST_STATIC_ASSERT(sizeof(element_type) > 0); } + { BOOST_MOVE_STATIC_ASSERT(sizeof(element_type) > 0); } }; } //namespace movelib { diff --git a/include/boost/move/detail/nsec_clock.hpp b/include/boost/move/detail/nsec_clock.hpp index 4de5c7d..8901e74 100644 --- a/include/boost/move/detail/nsec_clock.hpp +++ b/include/boost/move/detail/nsec_clock.hpp @@ -26,6 +26,7 @@ #include #include +#include #include @@ -39,25 +40,74 @@ #if defined(BOOST_MOVE_DETAIL_WINDOWS_API) -#include -#include -#include -#include -#include +#include + +#if defined( BOOST_USE_WINDOWS_H ) +#include +#else + +#if defined (WIN32_PLATFORM_PSPC) +#define BOOST_MOVE_WINAPI_IMPORT BOOST_SYMBOL_IMPORT +#define BOOST_MOVE_WINAPI_IMPORT_EXCEPT_WM +#elif defined (_WIN32_WCE) +#define BOOST_MOVE_WINAPI_IMPORT +#define BOOST_MOVE_WINAPI_IMPORT_EXCEPT_WM +#else +#define BOOST_MOVE_WINAPI_IMPORT BOOST_SYMBOL_IMPORT +#define BOOST_MOVE_WINAPI_IMPORT_EXCEPT_WM BOOST_SYMBOL_IMPORT +#endif + +#if defined(WINAPI) +#define BOOST_MOVE_WINAPI_CC WINAPI +#else + #if defined(_M_IX86) || defined(__i386__) + #define BOOST_MOVE_WINAPI_CC __stdcall + #else + // On architectures other than 32-bit x86 __stdcall is ignored. Clang also issues a warning. + #define BOOST_MOVE_WINAPI_CC + #endif +#endif + + +extern "C" { + +union _LARGE_INTEGER; +typedef long long QuadPart; + +BOOST_MOVE_WINAPI_IMPORT_EXCEPT_WM int BOOST_MOVE_WINAPI_CC +QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount); + +BOOST_MOVE_WINAPI_IMPORT_EXCEPT_WM int BOOST_MOVE_WINAPI_CC +QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency); + +} // extern "C" +#endif + namespace boost { namespace move_detail { +BOOST_FORCEINLINE int QueryPerformanceCounter(long long* lpPerformanceCount) +{ + return ::QueryPerformanceCounter(reinterpret_cast< ::_LARGE_INTEGER* >(lpPerformanceCount)); +} + +BOOST_FORCEINLINE int QueryPerformanceFrequency(long long* lpFrequency) +{ + return ::QueryPerformanceFrequency(reinterpret_cast< ::_LARGE_INTEGER* >(lpFrequency)); +} + + template struct QPFHolder { static inline double get_nsec_per_tic() { - boost::winapi::LARGE_INTEGER_ freq; - boost::winapi::BOOL_ r = boost::winapi::QueryPerformanceFrequency( &freq ); + long long freq; + int r = boost::move_detail::QueryPerformanceFrequency( &freq ); boost::movelib::ignore(r); - BOOST_ASSERT(r != 0 && "Boost::Move - get_nanosecs_per_tic Internal Error"); + assert(r != 0 && "Boost::Move - get_nanosecs_per_tic Internal Error"); - return double(1000000000.0L / freq.QuadPart); + return double(1000000000.0L / double(freq)); } static const double nanosecs_per_tic; @@ -70,18 +120,18 @@ inline boost::uint64_t nsec_clock() BOOST_NOEXCEPT { double nanosecs_per_tic = QPFHolder<0>::nanosecs_per_tic; - boost::winapi::LARGE_INTEGER_ pcount; + long long pcount; unsigned times=0; - while ( !boost::winapi::QueryPerformanceCounter( &pcount ) ) + while ( !boost::move_detail::QueryPerformanceCounter( &pcount ) ) { if ( ++times > 3 ) { - BOOST_ASSERT("Boost::Move - QueryPerformanceCounter Internal Error"); + assert("Boost::Move - QueryPerformanceCounter Internal Error"); return 0u; } } - return static_cast(nanosecs_per_tic * double(pcount.QuadPart)); + return static_cast(nanosecs_per_tic * double(pcount)); } }} //namespace boost { namespace move_detail { diff --git a/include/boost/move/detail/type_traits.hpp b/include/boost/move/detail/type_traits.hpp index 3bf5d59..5a09318 100644 --- a/include/boost/move/detail/type_traits.hpp +++ b/include/boost/move/detail/type_traits.hpp @@ -30,8 +30,7 @@ // move/detail #include // other -#include -#include +#include // std #include @@ -1238,7 +1237,7 @@ struct aligned_next; template struct aligned_next { - BOOST_STATIC_ASSERT((alignment_of::value == Align)); + BOOST_MOVE_STATIC_ASSERT((alignment_of::value == Align)); typedef aligned_union type; }; @@ -1278,13 +1277,13 @@ template::value> struct aligned_storage { //Sanity checks for input parameters - BOOST_STATIC_ASSERT(Align > 0); + BOOST_MOVE_STATIC_ASSERT(Align > 0); //Sanity checks for output type typedef typename aligned_storage_impl::type type; static const std::size_t value = alignment_of::value; - BOOST_STATIC_ASSERT(value >= Align); - BOOST_STATIC_ASSERT((value % Align) == 0); + BOOST_MOVE_STATIC_ASSERT(value >= Align); + BOOST_MOVE_STATIC_ASSERT((value % Align) == 0); //Just in case someone instantiates aligned_storage //instead of aligned_storage::type (typical error). diff --git a/include/boost/move/detail/workaround.hpp b/include/boost/move/detail/workaround.hpp index e81739e..18aeda5 100644 --- a/include/boost/move/detail/workaround.hpp +++ b/include/boost/move/detail/workaround.hpp @@ -103,5 +103,32 @@ BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&) # define BOOST_MOVE_CATCH_END } #endif +#ifndef BOOST_NO_CXX11_STATIC_ASSERT +# ifndef BOOST_NO_CXX11_VARIADIC_MACROS +# define BOOST_MOVE_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__) +# else +# define BOOST_MOVE_STATIC_ASSERT( B ) static_assert(B, #B) +# endif +#else +namespace boost { +namespace move_detail { + +template +struct STATIC_ASSERTION_FAILURE; + +template<> +struct STATIC_ASSERTION_FAILURE{}; + +template struct static_assert_test {}; + +}} + +#define BOOST_MOVE_STATIC_ASSERT(B) \ + typedef ::boost::move_detail::static_assert_test<\ + sizeof(::boost::move_detail::STATIC_ASSERTION_FAILURE)>\ + BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED + +#endif + #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP diff --git a/include/boost/move/unique_ptr.hpp b/include/boost/move/unique_ptr.hpp index 5f9a107..2102872 100644 --- a/include/boost/move/unique_ptr.hpp +++ b/include/boost/move/unique_ptr.hpp @@ -25,8 +25,7 @@ #include #include #include -#include -#include +#include #include //For std::nullptr_t and std::size_t @@ -394,8 +393,8 @@ class unique_ptr { //If this constructor is instantiated with a pointer type or reference type //for the template argument D, the program is ill-formed. - BOOST_STATIC_ASSERT(!bmupmu::is_pointer::value); - BOOST_STATIC_ASSERT(!bmupmu::is_reference::value); + BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_pointer::value); + BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_reference::value); } //! Effects: Same as unique_ptr() (default constructor). @@ -405,8 +404,8 @@ class unique_ptr { //If this constructor is instantiated with a pointer type or reference type //for the template argument D, the program is ill-formed. - BOOST_STATIC_ASSERT(!bmupmu::is_pointer::value); - BOOST_STATIC_ASSERT(!bmupmu::is_reference::value); + BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_pointer::value); + BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_reference::value); } //! Requires: D shall satisfy the requirements of DefaultConstructible, and @@ -430,12 +429,12 @@ class unique_ptr { //If T is not an array type, element_type_t derives from T //it uses the default deleter and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor ::type>::value )); //If this constructor is instantiated with a pointer type or reference type //for the template argument D, the program is ill-formed. - BOOST_STATIC_ASSERT(!bmupmu::is_pointer::value); - BOOST_STATIC_ASSERT(!bmupmu::is_reference::value); + BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_pointer::value); + BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_reference::value); } //!The signature of this constructor depends upon whether D is a reference type. @@ -468,7 +467,7 @@ class unique_ptr { //If T is not an array type, element_type_t derives from T //it uses the default deleter and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor ::type>::value )); } @@ -506,7 +505,7 @@ class unique_ptr { //If T is not an array type, element_type_t derives from T //it uses the default deleter and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor ::type>::value )); } @@ -553,7 +552,7 @@ class unique_ptr { //If T is not an array type, U derives from T //it uses the default deleter and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor ::pointer>::value )); } @@ -620,7 +619,7 @@ class unique_ptr BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference::type) operator*() const BOOST_NOEXCEPT { - BOOST_STATIC_ASSERT((!bmupmu::is_array::value)); + BOOST_MOVE_STATIC_ASSERT((!bmupmu::is_array::value)); return *m_data.m_p; } @@ -632,8 +631,8 @@ class unique_ptr BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference::type) operator[](std::size_t i) const BOOST_NOEXCEPT { - BOOST_ASSERT( bmupmu::extent::value == 0 || i < bmupmu::extent::value ); - BOOST_ASSERT(m_data.m_p); + assert( bmupmu::extent::value == 0 || i < bmupmu::extent::value ); + assert(m_data.m_p); return m_data.m_p[i]; } @@ -646,8 +645,8 @@ class unique_ptr //! Remarks() const BOOST_NOEXCEPT { - BOOST_STATIC_ASSERT((!bmupmu::is_array::value)); - BOOST_ASSERT(m_data.m_p); + BOOST_MOVE_STATIC_ASSERT((!bmupmu::is_array::value)); + assert(m_data.m_p); return m_data.m_p; } @@ -711,7 +710,7 @@ class unique_ptr { //If T is not an array type, element_type_t derives from T //it uses the default deleter and T has no virtual destructor, then you have a problem - BOOST_STATIC_ASSERT(( !bmupd::missing_virtual_destructor + BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor ::type>::value )); pointer tmp = m_data.m_p; m_data.m_p = p; diff --git a/include/boost/move/utility_core.hpp b/include/boost/move/utility_core.hpp index edc1a73..814ba08 100644 --- a/include/boost/move/utility_core.hpp +++ b/include/boost/move/utility_core.hpp @@ -29,7 +29,6 @@ #include //forceinline #include #include -#include #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) @@ -252,7 +251,7 @@ BOOST_MOVE_FORCEINLINE T&& forward(typename ::boost::move_detail::remove_reference::type&& t) BOOST_NOEXCEPT { //"boost::forward error: 'T' is a lvalue reference, can't forward as rvalue."; - BOOST_STATIC_ASSERT(!boost::move_detail::is_lvalue_reference::value); + BOOST_MOVE_STATIC_ASSERT(!boost::move_detail::is_lvalue_reference::value); return static_cast(t); } @@ -292,7 +291,7 @@ BOOST_MOVE_FORCEINLINE T&& move_if_not_lvalue_reference(typename ::boost::move_detail::remove_reference::type&& t) BOOST_NOEXCEPT { //"boost::forward error: 'T' is a lvalue reference, can't forward as rvalue."; - BOOST_STATIC_ASSERT(!boost::move_detail::is_lvalue_reference::value); + BOOST_MOVE_STATIC_ASSERT(!boost::move_detail::is_lvalue_reference::value); return static_cast(t); } diff --git a/test/bench_merge.cpp b/test/bench_merge.cpp index 775a06e..a90a36f 100644 --- a/test/bench_merge.cpp +++ b/test/bench_merge.cpp @@ -110,7 +110,7 @@ const char *AlgoNames [] = { "StdMerge " , "StdQuartAdaptMerge " }; -BOOST_STATIC_ASSERT((sizeof(AlgoNames)/sizeof(*AlgoNames)) == MaxMerge); +BOOST_MOVE_STATIC_ASSERT((sizeof(AlgoNames)/sizeof(*AlgoNames)) == MaxMerge); template bool measure_algo(T *elements, std::size_t element_count, std::size_t split_pos, std::size_t alg, nanosecond_type &prev_clock) diff --git a/test/bench_sort.cpp b/test/bench_sort.cpp index 079f2c8..4c14c58 100644 --- a/test/bench_sort.cpp +++ b/test/bench_sort.cpp @@ -125,7 +125,7 @@ const char *AlgoNames [] = { "MergeSort " , "HeapSort " }; -BOOST_STATIC_ASSERT((sizeof(AlgoNames)/sizeof(*AlgoNames)) == MaxSort); +BOOST_MOVE_STATIC_ASSERT((sizeof(AlgoNames)/sizeof(*AlgoNames)) == MaxSort); template bool measure_algo(T *elements, std::size_t element_count, std::size_t alg, nanosecond_type &prev_clock) diff --git a/test/move.cpp b/test/move.cpp index 13c2686..5af15e2 100644 --- a/test/move.cpp +++ b/test/move.cpp @@ -12,7 +12,6 @@ #include #include "../example/movable.hpp" #include "../example/copymovable.hpp" -#include movable function(movable m) { @@ -96,12 +95,12 @@ R factory_wrapper(F f) int main() { #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_STATIC_ASSERT((boost::has_nothrow_move::value == true)); - BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); - BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); - BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); - BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); - BOOST_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); + BOOST_MOVE_STATIC_ASSERT((boost::has_nothrow_move::value == true)); + BOOST_MOVE_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); + BOOST_MOVE_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); + BOOST_MOVE_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); + BOOST_MOVE_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); + BOOST_MOVE_STATIC_ASSERT((boost::has_move_emulation_enabled::value == false)); #endif { diff --git a/test/move_if_noexcept.cpp b/test/move_if_noexcept.cpp index 9c9faff..777d706 100644 --- a/test/move_if_noexcept.cpp +++ b/test/move_if_noexcept.cpp @@ -14,7 +14,6 @@ #include #include "../example/movable.hpp" #include "../example/copymovable.hpp" -#include ////////////////////////////////////////////////////////////////////////////// //A copy_movable_noexcept class diff --git a/test/order_type.hpp b/test/order_type.hpp index 75115f3..88c7eda 100644 --- a/test/order_type.hpp +++ b/test/order_type.hpp @@ -87,13 +87,13 @@ struct order_move_type order_move_type(BOOST_RV_REF(order_move_type) other) : key(other.key), val(other.val) { - BOOST_ASSERT(this != &other); + assert(this != &other); other.key = other.val = std::size_t(-1); } order_move_type & operator=(BOOST_RV_REF(order_move_type) other) { - BOOST_ASSERT(this != &other); + assert(this != &other); key = other.key; val = other.val; other.key = other.val = std::size_t(-2); diff --git a/test/type_traits.cpp b/test/type_traits.cpp index 3625777..d8bdb97 100644 --- a/test/type_traits.cpp +++ b/test/type_traits.cpp @@ -11,7 +11,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include // @@ -54,9 +53,9 @@ namespace is_pod_test void test() { - BOOST_STATIC_ASSERT((boost::move_detail::is_pod::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_pod::value)); #if defined(BOOST_MOVE_IS_POD) - BOOST_STATIC_ASSERT((boost::move_detail::is_pod::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_pod::value)); #endif } @@ -67,24 +66,24 @@ namespace trivially_memcopyable_test { void test() { #if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) - BOOST_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible::value)); - BOOST_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable::value)); #endif //#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) //boost_move_type - BOOST_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible::value)); - BOOST_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable::value)); - BOOST_STATIC_ASSERT(!(boost::move_detail::is_copy_constructible::value)); - BOOST_STATIC_ASSERT(!(boost::move_detail::is_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_copy_assignable::value)); //POD - BOOST_STATIC_ASSERT((boost::move_detail::is_trivially_copy_constructible::value)); - BOOST_STATIC_ASSERT((boost::move_detail::is_trivially_copy_assignable::value)); - BOOST_STATIC_ASSERT((boost::move_detail::is_copy_constructible::value)); - BOOST_STATIC_ASSERT((boost::move_detail::is_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_assignable::value)); #if defined(BOOST_MOVE_IS_POD) - BOOST_STATIC_ASSERT((boost::move_detail::is_trivially_copy_constructible::value)); - BOOST_STATIC_ASSERT((boost::move_detail::is_trivially_copy_assignable::value)); - BOOST_STATIC_ASSERT((boost::move_detail::is_copy_constructible::value)); - BOOST_STATIC_ASSERT((boost::move_detail::is_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_assignable::value)); #endif } diff --git a/test/unique_ptr_assign.cpp b/test/unique_ptr_assign.cpp index 088b7f4..2a2212d 100644 --- a/test/unique_ptr_assign.cpp +++ b/test/unique_ptr_assign.cpp @@ -12,7 +12,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include ////////////////////////////////////////////// diff --git a/test/unique_ptr_ctordtor.cpp b/test/unique_ptr_ctordtor.cpp index a583b92..9b05980 100644 --- a/test/unique_ptr_ctordtor.cpp +++ b/test/unique_ptr_ctordtor.cpp @@ -12,7 +12,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include ////////////////////////////////////////////// diff --git a/test/unique_ptr_modifiers.cpp b/test/unique_ptr_modifiers.cpp index 5357328..610a7b1 100644 --- a/test/unique_ptr_modifiers.cpp +++ b/test/unique_ptr_modifiers.cpp @@ -12,7 +12,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include #include diff --git a/test/unique_ptr_movector.cpp b/test/unique_ptr_movector.cpp index ece216b..9017f96 100644 --- a/test/unique_ptr_movector.cpp +++ b/test/unique_ptr_movector.cpp @@ -12,7 +12,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include ////////////////////////////////////////////// @@ -267,7 +266,7 @@ void test() { //Single unique_ptr reset_counters(); - BOOST_STATIC_ASSERT((bmupmu::is_convertible::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_convertible::value)); { bml::unique_ptr > s(new B); A* p = s.get(); diff --git a/test/unique_ptr_nullptr.cpp b/test/unique_ptr_nullptr.cpp index dcd0e53..cd8888c 100644 --- a/test/unique_ptr_nullptr.cpp +++ b/test/unique_ptr_nullptr.cpp @@ -12,7 +12,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include ////////////////////////////////////////////// diff --git a/test/unique_ptr_observers.cpp b/test/unique_ptr_observers.cpp index 14376a0..bf0f0a8 100644 --- a/test/unique_ptr_observers.cpp +++ b/test/unique_ptr_observers.cpp @@ -12,7 +12,6 @@ ////////////////////////////////////////////////////////////////////////////// #include #include -#include #include ////////////////////////////////////////////// diff --git a/test/unique_ptr_test_utils_beg.hpp b/test/unique_ptr_test_utils_beg.hpp index 2563bf3..c3a9728 100644 --- a/test/unique_ptr_test_utils_beg.hpp +++ b/test/unique_ptr_test_utils_beg.hpp @@ -14,7 +14,6 @@ #define BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_BEG_HPP #include #include -#include #include ////////////////////////////////////////////// @@ -183,7 +182,7 @@ int B::count = 0; void reset_counters(); -BOOST_STATIC_ASSERT((::boost::move_upmu::is_convertible::value)); +BOOST_MOVE_STATIC_ASSERT((::boost::move_upmu::is_convertible::value)); //Incomplete Type function declarations struct I; diff --git a/test/unique_ptr_types.cpp b/test/unique_ptr_types.cpp index 7dbc0c3..acc5553 100644 --- a/test/unique_ptr_types.cpp +++ b/test/unique_ptr_types.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include ////////////////////////////////////////////// @@ -51,40 +50,40 @@ void test() //Single unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Unbounded array unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Bounded array unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Unbounded array of bounded array unique_ptr { typedef int int_5_t [5]; typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } { typedef int int_5_t [5]; typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } } @@ -104,29 +103,29 @@ void test() //Single unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same >::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same >::value)); } { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Unbounded array unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same >::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same >::value)); } { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Bounded array unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same >::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same >::value)); } { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } } @@ -143,17 +142,17 @@ void test() //Single unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Unbounded array unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } //Bounded array unique_ptr { typedef bml::unique_ptr P; - BOOST_STATIC_ASSERT((bmupmu::is_same::value)); + BOOST_MOVE_STATIC_ASSERT((bmupmu::is_same::value)); } } @@ -170,13 +169,13 @@ namespace unique_ptr_construct_assign_traits { typedef bml::unique_ptr unique_ptr_t; //Even if BOOST_MOVE_TT_CXX11_IS_COPY_CONSTRUCTIBLE is not defined //boost::unique_ptr shall work with boost::movelib traits - BOOST_STATIC_ASSERT(!(boost::move_detail::is_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_copy_constructible::value)); //Even if BOOST_MOVE_TT_CXX11_IS_COPY_ASSIGNABLE is not defined //boost::unique_ptr shall work with boost::movelib traits - BOOST_STATIC_ASSERT(!(boost::move_detail::is_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_copy_assignable::value)); //Important traits for containers like boost::vector - BOOST_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible::value)); - BOOST_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible::value)); + BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable::value)); } } //namespace unique_ptr_construct_assign_traits {