mirror of
https://github.com/boostorg/container.git
synced 2026-02-26 16:42:19 +00:00
Added constant static_vector<>/small_vector::static_capacity to use the configured capacity in constant expressions.
This commit is contained in:
@@ -502,9 +502,12 @@ class small_vector : public small_vector_base<T, Allocator>
|
||||
|
||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
|
||||
//! @brief The capacity/max size of the container
|
||||
static const size_type static_capacity = N;
|
||||
|
||||
public:
|
||||
BOOST_CONTAINER_FORCEINLINE small_vector()
|
||||
BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
|
||||
BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible<Allocator>::value)
|
||||
: base_type(initial_capacity_t(), internal_capacity())
|
||||
{}
|
||||
|
||||
|
||||
@@ -139,6 +139,9 @@ public:
|
||||
//! @brief The const reverse iterator.
|
||||
typedef typename base_t::const_reverse_iterator const_reverse_iterator;
|
||||
|
||||
//! @brief The capacity/max size of the container
|
||||
static const size_type static_capacity = Capacity;
|
||||
|
||||
//! @brief Constructs an empty static_vector.
|
||||
//!
|
||||
//! @par Throws
|
||||
|
||||
Reference in New Issue
Block a user