diff --git a/doc/move.qbk b/doc/move.qbk index 9a13ab1..bd2b907 100644 --- a/doc/move.qbk +++ b/doc/move.qbk @@ -805,6 +805,7 @@ Special thanks to: [section:release_notes_boost_1_79 Boost 1.79 Release] * Fixed bugs: + * [@https://github.com/boostorg/move/pull/46 Git Issue #46: ['"Include when BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE is defined"]]. * [@https://github.com/boostorg/move/issues/48 Git Issue #48: ['"MSVC warning C4643: Forward declaring 'nothrow_t' in namespace std is not permitted by the C++ Standard"]]. [endsect] diff --git a/include/boost/move/algo/detail/merge.hpp b/include/boost/move/algo/detail/merge.hpp index 0491fa0..6b05109 100644 --- a/include/boost/move/algo/detail/merge.hpp +++ b/include/boost/move/algo/detail/merge.hpp @@ -44,12 +44,12 @@ class adaptive_xbuf typedef RandRawIt iterator; typedef SizeType size_type; - adaptive_xbuf() + BOOST_MOVE_FORCEINLINE adaptive_xbuf() : m_ptr(), m_size(0), m_capacity(0) {} - adaptive_xbuf(RandRawIt raw_memory, size_type capacity) - : m_ptr(raw_memory), m_size(0), m_capacity(capacity) + BOOST_MOVE_FORCEINLINE adaptive_xbuf(RandRawIt raw_memory, size_type cap) + : m_ptr(raw_memory), m_size(0), m_capacity(cap) {} template @@ -58,9 +58,9 @@ class adaptive_xbuf typedef typename iterator_traits::difference_type rand_diff_t; if(n <= m_size){ boost::move(first, first+rand_diff_t(n), m_ptr); - size_type size = m_size; - while(size-- != n){ - m_ptr[size].~T(); + size_type sz = m_size; + while(sz-- != n){ + m_ptr[sz].~T(); } m_size = n; } @@ -103,30 +103,30 @@ class adaptive_xbuf } } - void set_size(size_type size) + BOOST_MOVE_FORCEINLINE void set_size(size_type sz) { - m_size = size; + m_size = sz; } - void shrink_to_fit(size_type const size) + void shrink_to_fit(size_type const sz) { - if(m_size > size){ - for(size_type szt_i = size; szt_i != m_size; ++szt_i){ + if(m_size > sz){ + for(size_type szt_i = sz; szt_i != m_size; ++szt_i){ m_ptr[szt_i].~T(); } - m_size = size; + m_size = sz; } } - void initialize_until(size_type const size, T &t) + void initialize_until(size_type const sz, T &t) { BOOST_ASSERT(m_size < m_capacity); - if(m_size < size){ + if(m_size < sz){ BOOST_TRY { ::new((void*)&m_ptr[m_size]) T(::boost::move(t)); ++m_size; - for(; m_size != size; ++m_size){ + for(; m_size != sz; ++m_size){ ::new((void*)&m_ptr[m_size]) T(::boost::move(m_ptr[m_size-1])); } t = ::boost::move(m_ptr[m_size-1]); @@ -145,22 +145,22 @@ class adaptive_xbuf private: template - static bool is_raw_ptr(RIt) + BOOST_MOVE_FORCEINLINE static bool is_raw_ptr(RIt) { return false; } - static bool is_raw_ptr(T*) + BOOST_MOVE_FORCEINLINE static bool is_raw_ptr(T*) { return true; } public: template - bool supports_aligned_trailing(size_type size, size_type trail_count) const + bool supports_aligned_trailing(size_type sz, size_type trail_count) const { if(this->is_raw_ptr(this->data()) && m_capacity){ - uintptr_t u_addr_sz = uintptr_t(&*(this->data()+size)); + uintptr_t u_addr_sz = uintptr_t(&*(this->data()+sz)); uintptr_t u_addr_cp = uintptr_t(&*(this->data()+this->capacity())); u_addr_sz = ((u_addr_sz + sizeof(U)-1)/sizeof(U))*sizeof(U); return (u_addr_cp >= u_addr_sz) && ((u_addr_cp - u_addr_sz)/sizeof(U) >= trail_count); @@ -169,43 +169,43 @@ class adaptive_xbuf } template - U *aligned_trailing() const + BOOST_MOVE_FORCEINLINE U *aligned_trailing() const { return this->aligned_trailing(this->size()); } template - U *aligned_trailing(size_type pos) const + BOOST_MOVE_FORCEINLINE U *aligned_trailing(size_type pos) const { uintptr_t u_addr = uintptr_t(&*(this->data()+pos)); u_addr = ((u_addr + sizeof(U)-1)/sizeof(U))*sizeof(U); return (U*)u_addr; } - ~adaptive_xbuf() + BOOST_MOVE_FORCEINLINE ~adaptive_xbuf() { this->clear(); } - size_type capacity() const + BOOST_MOVE_FORCEINLINE size_type capacity() const { return m_capacity; } - iterator data() const + BOOST_MOVE_FORCEINLINE iterator data() const { return m_ptr; } - iterator begin() const + BOOST_MOVE_FORCEINLINE iterator begin() const { return m_ptr; } - iterator end() const + BOOST_MOVE_FORCEINLINE iterator end() const { return m_ptr+m_size; } - size_type size() const + BOOST_MOVE_FORCEINLINE size_type size() const { return m_size; } - bool empty() const + BOOST_MOVE_FORCEINLINE bool empty() const { return !m_size; } - void clear() + BOOST_MOVE_FORCEINLINE void clear() { this->shrink_to_fit(0u); } @@ -269,10 +269,10 @@ class range_xbuf return pos; } - void set_size(size_type size) + void set_size(size_type sz) { m_last = m_first; - m_last += size; + m_last += sz; } private: diff --git a/include/boost/move/algo/predicate.hpp b/include/boost/move/algo/predicate.hpp index ca76b75..18dc4ee 100644 --- a/include/boost/move/algo/predicate.hpp +++ b/include/boost/move/algo/predicate.hpp @@ -24,19 +24,19 @@ namespace movelib { template struct antistable { - explicit antistable(Comp &comp) + BOOST_MOVE_FORCEINLINE explicit antistable(Comp &comp) : m_comp(comp) {} - antistable(const antistable & other) + BOOST_MOVE_FORCEINLINE antistable(const antistable & other) : m_comp(other.m_comp) {} template - bool operator()(const U &u, const V & v) + BOOST_MOVE_FORCEINLINE bool operator()(const U &u, const V & v) { return !m_comp(v, u); } - const Comp &get() const + BOOST_MOVE_FORCEINLINE const Comp &get() const { return m_comp; } private: @@ -56,15 +56,15 @@ template class negate { public: - negate() + BOOST_MOVE_FORCEINLINE negate() {} - explicit negate(Comp comp) + BOOST_MOVE_FORCEINLINE explicit negate(Comp comp) : m_comp(comp) {} template - bool operator()(const T1& l, const T2& r) + BOOST_MOVE_FORCEINLINE bool operator()(const T1& l, const T2& r) { return !m_comp(l, r); } @@ -78,15 +78,15 @@ template class inverse { public: - inverse() + BOOST_MOVE_FORCEINLINE inverse() {} - explicit inverse(Comp comp) + BOOST_MOVE_FORCEINLINE explicit inverse(Comp comp) : m_comp(comp) {} template - bool operator()(const T1& l, const T2& r) + BOOST_MOVE_FORCEINLINE bool operator()(const T1& l, const T2& r) { return m_comp(r, l); } diff --git a/test/unique_ptr_functions.cpp b/test/unique_ptr_functions.cpp index 2897509..8018671 100644 --- a/test/unique_ptr_functions.cpp +++ b/test/unique_ptr_functions.cpp @@ -18,9 +18,9 @@ struct A int a, b, c; static int count; A() : a (999), b(1000), c(1001) {++count;} - A(int a) : a (a), b(1000), c(1001) {++count;} - A(int a, int b) : a (a), b(b), c(1001) {++count;} - A(int a, int b, int c) : a (a), b(b), c(c) {++count;} + A(int x) : a (x), b(1000), c(1001) {++count;} + A(int x, int y) : a (x), b(y), c(1001) {++count;} + A(int x, int y, int z) : a (x), b(y), c(z) {++count;} A(const A&) {++count;} virtual ~A() {--count;} };