forked from boostorg/unordered
Add defaulted copy assignment operators when supported
This commit is contained in:
@ -181,12 +181,9 @@ namespace test
|
|||||||
|
|
||||||
~cxx11_allocator_base() { detail::tracker.allocator_unref(); }
|
~cxx11_allocator_base() { detail::tracker.allocator_unref(); }
|
||||||
|
|
||||||
cxx11_allocator_base& operator=(cxx11_allocator_base const& x)
|
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||||
{
|
cxx11_allocator_base& operator=(cxx11_allocator_base const& x) = default;
|
||||||
tag_ = x.tag_;
|
#endif
|
||||||
selected_ = x.selected_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
pointer address(reference r) { return pointer(&r); }
|
pointer address(reference r) { return pointer(&r); }
|
||||||
|
|
||||||
@ -272,11 +269,9 @@ namespace test
|
|||||||
|
|
||||||
cxx11_allocator(cxx11_allocator const& x) : cxx11_allocator_base<T>(x) {}
|
cxx11_allocator(cxx11_allocator const& x) : cxx11_allocator_base<T>(x) {}
|
||||||
|
|
||||||
cxx11_allocator& operator=(cxx11_allocator const& x)
|
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||||
{
|
cxx11_allocator& operator=(cxx11_allocator const& x) = default;
|
||||||
cxx11_allocator_base<T>::operator=(x);
|
#endif
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// When not propagating swap, allocators are always equal
|
// When not propagating swap, allocators are always equal
|
||||||
// to avoid undefined behaviour.
|
// to avoid undefined behaviour.
|
||||||
@ -321,11 +316,9 @@ namespace test
|
|||||||
|
|
||||||
cxx11_allocator(cxx11_allocator const& x) : cxx11_allocator_base<T>(x) {}
|
cxx11_allocator(cxx11_allocator const& x) : cxx11_allocator_base<T>(x) {}
|
||||||
|
|
||||||
cxx11_allocator& operator=(cxx11_allocator const& x)
|
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||||
{
|
cxx11_allocator& operator=(cxx11_allocator const& x) = default;
|
||||||
cxx11_allocator_base<T>::operator=(x);
|
#endif
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// When not propagating swap, allocators are always equal
|
// When not propagating swap, allocators are always equal
|
||||||
// to avoid undefined behaviour.
|
// to avoid undefined behaviour.
|
||||||
|
Reference in New Issue
Block a user