Modify flat associative containers to be adaptors if the allocator argument is a container. This allows using stable_vector, small_vector, static_vector as underlying containers.

This commit is contained in:
Ion Gaztañaga
2017-08-27 12:40:15 +02:00
parent 6530b7870f
commit 2297f6af72
16 changed files with 1008 additions and 474 deletions

View File

@@ -113,6 +113,8 @@ class static_vector
template<class U, std::size_t OtherCapacity>
friend class static_vector;
public:
typedef container_detail::static_storage_allocator<Value, Capacity> allocator_type;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
public:
@@ -252,6 +254,19 @@ public:
: base_t(other)
{}
BOOST_CONTAINER_FORCEINLINE static_vector(static_vector const& other, const allocator_type &)
: base_t(other)
{}
BOOST_CONTAINER_FORCEINLINE static_vector(BOOST_RV_REF(static_vector) other, const allocator_type &)
BOOST_NOEXCEPT_IF(boost::container::container_detail::is_nothrow_move_constructible<value_type>::value)
: base_t(BOOST_MOVE_BASE(base_t, other))
{}
BOOST_CONTAINER_FORCEINLINE explicit static_vector(const allocator_type &)
: base_t()
{}
//! @pre <tt>other.size() <= capacity()</tt>.
//!
//! @brief Constructs a copy of other static_vector.