Remove BOOST_MOVABLE_BUT_NOT_COPYABLE from basic_string_base as it comflicts with is_copy_constructible and other utilities that inspect the internal tag looking for noncopyable types.

This commit is contained in:
Ion Gaztañaga
2014-08-29 14:19:54 +02:00
parent ff6e90a720
commit abc8f80ea6

View File

@@ -67,11 +67,12 @@ namespace container_detail {
template <class Allocator> template <class Allocator>
class basic_string_base class basic_string_base
{ {
BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_string_base) basic_string_base & operator=(const basic_string_base &);
basic_string_base(const basic_string_base &);
typedef allocator_traits<Allocator> allocator_traits_type; typedef allocator_traits<Allocator> allocator_traits_type;
public: public:
typedef Allocator allocator_type; typedef Allocator allocator_type;
typedef allocator_type stored_allocator_type; typedef allocator_type stored_allocator_type;
typedef typename allocator_traits_type::pointer pointer; typedef typename allocator_traits_type::pointer pointer;
typedef typename allocator_traits_type::value_type value_type; typedef typename allocator_traits_type::value_type value_type;
@@ -86,6 +87,10 @@ class basic_string_base
: members_(a) : members_(a)
{ init(); } { init(); }
basic_string_base(BOOST_RV_REF(allocator_type) a)
: members_(boost::move(a))
{ this->init(); }
basic_string_base(const allocator_type& a, size_type n) basic_string_base(const allocator_type& a, size_type n)
: members_(a) : members_(a)
{ {
@@ -93,13 +98,6 @@ class basic_string_base
this->allocate_initial_block(n); this->allocate_initial_block(n);
} }
basic_string_base(BOOST_RV_REF(basic_string_base) b)
: members_(boost::move(b.alloc()))
{
this->init();
this->swap_data(b);
}
~basic_string_base() ~basic_string_base()
{ {
if(!this->is_short()){ if(!this->is_short()){
@@ -606,8 +604,15 @@ class basic_string
//! //!
//! <b>Complexity</b>: Constant. //! <b>Complexity</b>: Constant.
basic_string(BOOST_RV_REF(basic_string) s) BOOST_CONTAINER_NOEXCEPT basic_string(BOOST_RV_REF(basic_string) s) BOOST_CONTAINER_NOEXCEPT
: base_t(boost::move((base_t&)s)) : base_t(boost::move(s.alloc()))
{} {
if(s.alloc() == this->alloc()){
this->swap_data(s);
}
else{
this->assign(s.begin(), s.end());
}
}
//! <b>Effects</b>: Copy constructs a basic_string using the specified allocator. //! <b>Effects</b>: Copy constructs a basic_string using the specified allocator.
//! //!