Ticket #6947: dynamic_bitset.hpp.patch

File dynamic_bitset.hpp.patch, 1.8 KB (added by Arkadiy Shapkin <arkadiy_s@…>, 10 years ago)

Patch that fix issue

  • boost/dynamic_bitset/dynamic_bitset.hpp

     
    3939#include "boost/static_assert.hpp"
    4040#include "boost/limits.hpp"
    4141#include "boost/pending/lowest_bit.hpp"
     42#include "boost/move/move.hpp"
    4243
    4344
    4445namespace boost {
     
    207208    void swap(dynamic_bitset& b);
    208209    dynamic_bitset& operator=(const dynamic_bitset& b);
    209210
     211#   ifndef BOOST_NO_RVALUE_REFERENCES
     212    //==========================================================================
     213    //= Move semantics
     214    //==========================================================================
     215
     216    dynamic_bitset(dynamic_bitset&& src);
     217
     218    dynamic_bitset& operator = (dynamic_bitset&& src) ;
     219    //==========================================================================
     220#   endif // BOOST_NO_RVALUE_REFERENCES
     221
    210222    allocator_type get_allocator() const;
    211223
    212224    // size changing operations
     
    633645    return *this;
    634646}
    635647
     648#   ifndef BOOST_NO_RVALUE_REFERENCES
     649
     650// Move semantics
    636651template <typename Block, typename Allocator>
     652inline dynamic_bitset<Block, Allocator>::dynamic_bitset(dynamic_bitset<Block, Allocator>&& src)
     653        : m_bits(boost::move(src.m_bits)), m_num_bits(src.m_num_bits)
     654{
     655        src.m_num_bits = 0;
     656}
     657
     658template <typename Block, typename Allocator>
     659inline dynamic_bitset<Block, Allocator>& dynamic_bitset<Block, Allocator>::
     660        operator = (dynamic_bitset<Block, Allocator>&& src)
     661{
     662        swap(src);
     663        return *this;
     664}
     665
     666#   endif // BOOST_NO_RVALUE_REFERENCES
     667
     668template <typename Block, typename Allocator>
    637669inline typename dynamic_bitset<Block, Allocator>::allocator_type
    638670dynamic_bitset<Block, Allocator>::get_allocator() const
    639671{