forked from boostorg/container
Introduced BOOST_CONTAINER_FORCEINLINE so that mandatory inlining can be disabled selectively
This commit is contained in:
@@ -96,13 +96,13 @@ class vec_iterator
|
||||
Pointer m_ptr;
|
||||
|
||||
public:
|
||||
const Pointer &get_ptr() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const Pointer &get_ptr() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return m_ptr; }
|
||||
|
||||
Pointer &get_ptr() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE Pointer &get_ptr() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return m_ptr; }
|
||||
|
||||
explicit vec_iterator(Pointer ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE explicit vec_iterator(Pointer ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
: m_ptr(ptr)
|
||||
{}
|
||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
@@ -110,73 +110,73 @@ class vec_iterator
|
||||
public:
|
||||
|
||||
//Constructors
|
||||
vec_iterator() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
: m_ptr() //Value initialization to achieve "null iterators" (N3644)
|
||||
{}
|
||||
|
||||
vec_iterator(vec_iterator<Pointer, false> const& other) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator(vec_iterator<Pointer, false> const& other) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
: m_ptr(other.get_ptr())
|
||||
{}
|
||||
|
||||
//Pointer like operators
|
||||
reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE reference operator*() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return *m_ptr; }
|
||||
|
||||
pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return ::boost::intrusive::pointer_traits<pointer>::pointer_to(this->operator*()); }
|
||||
|
||||
reference operator[](difference_type off) const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE reference operator[](difference_type off) const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return m_ptr[off]; }
|
||||
|
||||
//Increment / Decrement
|
||||
vec_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator& operator++() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ ++m_ptr; return *this; }
|
||||
|
||||
vec_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator operator++(int) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return vec_iterator(m_ptr++); }
|
||||
|
||||
vec_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator& operator--() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ --m_ptr; return *this; }
|
||||
|
||||
vec_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator operator--(int) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return vec_iterator(m_ptr--); }
|
||||
|
||||
//Arithmetic
|
||||
vec_iterator& operator+=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator& operator+=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ m_ptr += off; return *this; }
|
||||
|
||||
vec_iterator& operator-=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE vec_iterator& operator-=(difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ m_ptr -= off; return *this; }
|
||||
|
||||
friend vec_iterator operator+(const vec_iterator &x, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator+(const vec_iterator &x, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return vec_iterator(x.m_ptr+off); }
|
||||
|
||||
friend vec_iterator operator+(difference_type off, vec_iterator right) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator+(difference_type off, vec_iterator right) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ right.m_ptr += off; return right; }
|
||||
|
||||
friend vec_iterator operator-(vec_iterator left, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend vec_iterator operator-(vec_iterator left, difference_type off) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ left.m_ptr -= off; return left; }
|
||||
|
||||
friend difference_type operator-(const vec_iterator &left, const vec_iterator& right) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend difference_type operator-(const vec_iterator &left, const vec_iterator& right) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return left.m_ptr - right.m_ptr; }
|
||||
|
||||
//Comparison operators
|
||||
friend bool operator== (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend bool operator== (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return l.m_ptr == r.m_ptr; }
|
||||
|
||||
friend bool operator!= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend bool operator!= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return l.m_ptr != r.m_ptr; }
|
||||
|
||||
friend bool operator< (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend bool operator< (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return l.m_ptr < r.m_ptr; }
|
||||
|
||||
friend bool operator<= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend bool operator<= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return l.m_ptr <= r.m_ptr; }
|
||||
|
||||
friend bool operator> (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend bool operator> (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return l.m_ptr > r.m_ptr; }
|
||||
|
||||
friend bool operator>= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE friend bool operator>= (const vec_iterator& l, const vec_iterator& r) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return l.m_ptr >= r.m_ptr; }
|
||||
};
|
||||
|
||||
@@ -186,7 +186,7 @@ struct vector_insert_ordered_cursor
|
||||
typedef typename iterator_traits<BiDirPosConstIt>::value_type size_type;
|
||||
typedef typename iterator_traits<BiDirValueIt>::reference reference;
|
||||
|
||||
vector_insert_ordered_cursor(BiDirPosConstIt posit, BiDirValueIt valueit)
|
||||
BOOST_CONTAINER_FORCEINLINE vector_insert_ordered_cursor(BiDirPosConstIt posit, BiDirValueIt valueit)
|
||||
: last_position_it(posit), last_value_it(valueit)
|
||||
{}
|
||||
|
||||
@@ -200,10 +200,10 @@ struct vector_insert_ordered_cursor
|
||||
}
|
||||
}
|
||||
|
||||
size_type get_pos() const
|
||||
BOOST_CONTAINER_FORCEINLINE size_type get_pos() const
|
||||
{ return *last_position_it; }
|
||||
|
||||
reference get_val()
|
||||
BOOST_CONTAINER_FORCEINLINE reference get_val()
|
||||
{ return *last_value_it; }
|
||||
|
||||
BiDirPosConstIt last_position_it;
|
||||
@@ -216,7 +216,7 @@ struct vector_merge_cursor
|
||||
typedef SizeType size_type;
|
||||
typedef typename iterator_traits<BiDirValueIt>::reference reference;
|
||||
|
||||
vector_merge_cursor(T *pbeg, T *plast, BiDirValueIt valueit, Comp &cmp)
|
||||
BOOST_CONTAINER_FORCEINLINE vector_merge_cursor(T *pbeg, T *plast, BiDirValueIt valueit, Comp &cmp)
|
||||
: m_pbeg(pbeg), m_pcur(--plast), m_valueit(valueit), m_cmp(cmp)
|
||||
{}
|
||||
|
||||
@@ -232,10 +232,10 @@ struct vector_merge_cursor
|
||||
}
|
||||
}
|
||||
|
||||
size_type get_pos() const
|
||||
BOOST_CONTAINER_FORCEINLINE size_type get_pos() const
|
||||
{ return static_cast<size_type>((m_pcur + 1) - m_pbeg); }
|
||||
|
||||
reference get_val()
|
||||
BOOST_CONTAINER_FORCEINLINE reference get_val()
|
||||
{ return *m_valueit; }
|
||||
|
||||
T *const m_pbeg;
|
||||
@@ -247,11 +247,11 @@ struct vector_merge_cursor
|
||||
} //namespace container_detail {
|
||||
|
||||
template<class Pointer, bool IsConst>
|
||||
const Pointer &vector_iterator_get_ptr(const container_detail::vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const Pointer &vector_iterator_get_ptr(const container_detail::vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return it.get_ptr(); }
|
||||
|
||||
template<class Pointer, bool IsConst>
|
||||
Pointer &get_ptr(container_detail::vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE Pointer &get_ptr(container_detail::vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return it.get_ptr(); }
|
||||
|
||||
namespace container_detail {
|
||||
@@ -270,7 +270,7 @@ struct vector_get_ptr_pointer_to_non_const
|
||||
typedef typename pointer_traits_t
|
||||
::template rebind_pointer<non_const_element_type>::type return_type;
|
||||
|
||||
static return_type get_ptr(const const_pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE static return_type get_ptr(const const_pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return boost::intrusive::pointer_traits<return_type>::const_cast_from(ptr); }
|
||||
};
|
||||
|
||||
@@ -278,14 +278,14 @@ template<class Pointer>
|
||||
struct vector_get_ptr_pointer_to_non_const<Pointer, false>
|
||||
{
|
||||
typedef const Pointer & return_type;
|
||||
static return_type get_ptr(const Pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE static return_type get_ptr(const Pointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return ptr; }
|
||||
};
|
||||
|
||||
} //namespace container_detail {
|
||||
|
||||
template<class MaybeConstPointer>
|
||||
typename container_detail::vector_get_ptr_pointer_to_non_const<MaybeConstPointer>::return_type
|
||||
BOOST_CONTAINER_FORCEINLINE typename container_detail::vector_get_ptr_pointer_to_non_const<MaybeConstPointer>::return_type
|
||||
vector_iterator_get_ptr(const MaybeConstPointer &ptr) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
return container_detail::vector_get_ptr_pointer_to_non_const<MaybeConstPointer>::get_ptr(ptr);
|
||||
@@ -451,14 +451,14 @@ struct vector_alloc_holder
|
||||
, m_capacity(n)
|
||||
{}
|
||||
|
||||
~vector_alloc_holder() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE ~vector_alloc_holder() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
if(this->m_capacity){
|
||||
this->alloc().deallocate(this->m_start, this->m_capacity);
|
||||
}
|
||||
}
|
||||
|
||||
pointer allocation_command(boost::container::allocation_type command,
|
||||
BOOST_CONTAINER_FORCEINLINE pointer allocation_command(boost::container::allocation_type command,
|
||||
size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse)
|
||||
{
|
||||
typedef typename container_detail::version<Allocator>::type alloc_version;
|
||||
@@ -482,7 +482,7 @@ struct vector_alloc_holder
|
||||
return success;
|
||||
}
|
||||
|
||||
size_type next_capacity(size_type additional_objects) const
|
||||
BOOST_CONTAINER_FORCEINLINE size_type next_capacity(size_type additional_objects) const
|
||||
{
|
||||
return next_capacity_calculator
|
||||
<size_type, NextCapacityDouble //NextCapacity60Percent
|
||||
@@ -510,10 +510,10 @@ struct vector_alloc_holder
|
||||
x.m_size = x.m_capacity = 0;
|
||||
}
|
||||
|
||||
Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return *this; }
|
||||
|
||||
const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return *this; }
|
||||
|
||||
const pointer &start() const BOOST_NOEXCEPT_OR_NOTHROW { return m_start; }
|
||||
@@ -534,7 +534,7 @@ struct vector_alloc_holder
|
||||
}
|
||||
}
|
||||
|
||||
pointer priv_allocation_command(version_1, boost::container::allocation_type command,
|
||||
BOOST_CONTAINER_FORCEINLINE pointer priv_allocation_command(version_1, boost::container::allocation_type command,
|
||||
size_type ,
|
||||
size_type &prefer_in_recvd_out_size,
|
||||
pointer &reuse)
|
||||
@@ -624,14 +624,14 @@ struct vector_alloc_holder<Allocator, version_0>
|
||||
(this->alloc(), container_detail::to_raw_pointer(holder.start()), n, container_detail::to_raw_pointer(this->start()));
|
||||
}
|
||||
|
||||
void priv_first_allocation(size_type cap)
|
||||
BOOST_CONTAINER_FORCEINLINE void priv_first_allocation(size_type cap)
|
||||
{
|
||||
if(cap > Allocator::internal_capacity){
|
||||
throw_bad_alloc();
|
||||
}
|
||||
}
|
||||
|
||||
void deep_swap(vector_alloc_holder &x)
|
||||
BOOST_CONTAINER_FORCEINLINE void deep_swap(vector_alloc_holder &x)
|
||||
{
|
||||
this->priv_deep_swap(x);
|
||||
}
|
||||
@@ -645,28 +645,28 @@ struct vector_alloc_holder<Allocator, version_0>
|
||||
this->priv_deep_swap(x);
|
||||
}
|
||||
|
||||
void swap_resources(vector_alloc_holder &) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE void swap_resources(vector_alloc_holder &) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ //Containers with version 0 allocators can't be moved without moving elements one by one
|
||||
throw_bad_alloc();
|
||||
}
|
||||
|
||||
|
||||
void steal_resources(vector_alloc_holder &)
|
||||
BOOST_CONTAINER_FORCEINLINE void steal_resources(vector_alloc_holder &)
|
||||
{ //Containers with version 0 allocators can't be moved without moving elements one by one
|
||||
throw_bad_alloc();
|
||||
}
|
||||
|
||||
Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE Allocator &alloc() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return *this; }
|
||||
|
||||
const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const Allocator &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return *this; }
|
||||
|
||||
bool try_expand_fwd(size_type at_least)
|
||||
BOOST_CONTAINER_FORCEINLINE bool try_expand_fwd(size_type at_least)
|
||||
{ return !at_least; }
|
||||
|
||||
pointer start() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_storage(); }
|
||||
size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_capacity; }
|
||||
BOOST_CONTAINER_FORCEINLINE pointer start() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_storage(); }
|
||||
BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW { return Allocator::internal_capacity; }
|
||||
size_type m_size;
|
||||
|
||||
private:
|
||||
@@ -765,16 +765,16 @@ class vector
|
||||
|
||||
protected:
|
||||
|
||||
void steal_resources(vector &x)
|
||||
BOOST_CONTAINER_FORCEINLINE void steal_resources(vector &x)
|
||||
{ return this->m_holder.steal_resources(x.m_holder); }
|
||||
|
||||
struct initial_capacity_t{};
|
||||
template<class AllocFwd>
|
||||
vector(initial_capacity_t, pointer initial_memory, size_type capacity, BOOST_FWD_REF(AllocFwd) a)
|
||||
BOOST_CONTAINER_FORCEINLINE vector(initial_capacity_t, pointer initial_memory, size_type capacity, BOOST_FWD_REF(AllocFwd) a)
|
||||
: m_holder(initial_memory, capacity, ::boost::forward<AllocFwd>(a))
|
||||
{}
|
||||
|
||||
vector(initial_capacity_t, pointer initial_memory, size_type capacity)
|
||||
BOOST_CONTAINER_FORCEINLINE vector(initial_capacity_t, pointer initial_memory, size_type capacity)
|
||||
: m_holder(initial_memory, capacity)
|
||||
{}
|
||||
|
||||
@@ -1063,7 +1063,7 @@ class vector
|
||||
//! <b>Throws</b>: If memory allocation throws or T's copy/move constructor/assignment throws.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of elements in x.
|
||||
vector& operator=(BOOST_COPY_ASSIGN_REF(vector) x)
|
||||
BOOST_CONTAINER_FORCEINLINE vector& operator=(BOOST_COPY_ASSIGN_REF(vector) x)
|
||||
{
|
||||
if (&x != this){
|
||||
this->priv_copy_assign(x);
|
||||
@@ -1075,7 +1075,7 @@ class vector
|
||||
//! <b>Effects</b>: Make *this container contains elements from il.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the range [il.begin(), il.end()).
|
||||
vector& operator=(std::initializer_list<value_type> il)
|
||||
BOOST_CONTAINER_FORCEINLINE vector& operator=(std::initializer_list<value_type> il)
|
||||
{
|
||||
this->assign(il.begin(), il.end());
|
||||
return *this;
|
||||
@@ -1093,7 +1093,7 @@ class vector
|
||||
//! <b>Complexity</b>: Constant if allocator_traits_type::
|
||||
//! propagate_on_container_move_assignment is true or
|
||||
//! this->get>allocator() == x.get_allocator(). Linear otherwise.
|
||||
vector& operator=(BOOST_RV_REF(vector) x)
|
||||
BOOST_CONTAINER_FORCEINLINE vector& operator=(BOOST_RV_REF(vector) x)
|
||||
BOOST_NOEXCEPT_IF(allocator_traits_type::propagate_on_container_move_assignment::value
|
||||
|| allocator_traits_type::is_always_equal::value)
|
||||
{
|
||||
@@ -1115,7 +1115,7 @@ class vector
|
||||
//!
|
||||
//! <b>Note</b>: Non-standard extension to support static_vector
|
||||
template<class OtherAllocator>
|
||||
typename container_detail::enable_if_and
|
||||
BOOST_CONTAINER_FORCEINLINE typename container_detail::enable_if_and
|
||||
< vector&
|
||||
, container_detail::is_version<OtherAllocator, 0>
|
||||
, container_detail::is_different<OtherAllocator, allocator_type>
|
||||
@@ -1137,7 +1137,7 @@ class vector
|
||||
//!
|
||||
//! <b>Note</b>: Non-standard extension to support static_vector
|
||||
template<class OtherAllocator>
|
||||
typename container_detail::enable_if_and
|
||||
BOOST_CONTAINER_FORCEINLINE typename container_detail::enable_if_and
|
||||
< vector&
|
||||
, container_detail::is_version<OtherAllocator, 0>
|
||||
, container_detail::is_different<OtherAllocator, allocator_type>
|
||||
@@ -1193,7 +1193,7 @@ class vector
|
||||
//! <b>Throws</b>: If memory allocation throws or
|
||||
//! T's constructor from dereferencing iniializer_list iterator throws.
|
||||
//!
|
||||
void assign(std::initializer_list<T> il)
|
||||
BOOST_CONTAINER_FORCEINLINE void assign(std::initializer_list<T> il)
|
||||
{
|
||||
this->assign(il.begin(), il.end());
|
||||
}
|
||||
@@ -1269,7 +1269,7 @@ class vector
|
||||
//! T's copy/move constructor/assignment throws.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to n.
|
||||
void assign(size_type n, const value_type& val)
|
||||
BOOST_CONTAINER_FORCEINLINE void assign(size_type n, const value_type& val)
|
||||
{ this->assign(cvalue_iterator(val, n), cvalue_iterator()); }
|
||||
|
||||
//! <b>Effects</b>: Returns a copy of the internal allocator.
|
||||
@@ -1287,7 +1287,7 @@ class vector
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Note</b>: Non-standard extension.
|
||||
stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->m_holder.alloc(); }
|
||||
|
||||
//! <b>Effects</b>: Returns a reference to the internal allocator.
|
||||
@@ -1297,7 +1297,7 @@ class vector
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Note</b>: Non-standard extension.
|
||||
const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->m_holder.alloc(); }
|
||||
|
||||
//////////////////////////////////////////////
|
||||
@@ -1311,7 +1311,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
iterator begin() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE iterator begin() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return iterator(this->m_holder.start()); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the vector.
|
||||
@@ -1319,7 +1319,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return const_iterator(this->m_holder.start()); }
|
||||
|
||||
//! <b>Effects</b>: Returns an iterator to the end of the vector.
|
||||
@@ -1327,7 +1327,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
iterator end() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE iterator end() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return iterator(this->m_holder.start() + this->m_holder.m_size); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_iterator to the end of the vector.
|
||||
@@ -1335,7 +1335,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->cend(); }
|
||||
|
||||
//! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
|
||||
@@ -1344,7 +1344,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return reverse_iterator(this->end()); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
|
||||
@@ -1353,7 +1353,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->crbegin(); }
|
||||
|
||||
//! <b>Effects</b>: Returns a reverse_iterator pointing to the end
|
||||
@@ -1362,7 +1362,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return reverse_iterator(this->begin()); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
|
||||
@@ -1371,7 +1371,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->crend(); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_iterator to the first element contained in the vector.
|
||||
@@ -1379,7 +1379,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return const_iterator(this->m_holder.start()); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_iterator to the end of the vector.
|
||||
@@ -1387,7 +1387,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return const_iterator(this->m_holder.start() + this->m_holder.m_size); }
|
||||
|
||||
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
|
||||
@@ -1396,7 +1396,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return const_reverse_iterator(this->end());}
|
||||
|
||||
//! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
|
||||
@@ -1405,7 +1405,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return const_reverse_iterator(this->begin()); }
|
||||
|
||||
//////////////////////////////////////////////
|
||||
@@ -1419,7 +1419,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
bool empty() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE bool empty() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return !this->m_holder.m_size; }
|
||||
|
||||
//! <b>Effects</b>: Returns the number of the elements contained in the vector.
|
||||
@@ -1427,7 +1427,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
size_type size() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE size_type size() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->m_holder.m_size; }
|
||||
|
||||
//! <b>Effects</b>: Returns the largest possible size of the vector.
|
||||
@@ -1435,7 +1435,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE size_type max_size() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return allocator_traits_type::max_size(this->m_holder.alloc()); }
|
||||
|
||||
//! <b>Effects</b>: Inserts or erases elements at the end such that
|
||||
@@ -1473,7 +1473,7 @@ class vector
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
BOOST_CONTAINER_FORCEINLINE size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return this->m_holder.capacity(); }
|
||||
|
||||
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
|
||||
@@ -1482,7 +1482,7 @@ class vector
|
||||
//! n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
|
||||
//!
|
||||
//! <b>Throws</b>: If memory allocation allocation throws or T's copy/move constructor throws.
|
||||
void reserve(size_type new_cap)
|
||||
BOOST_CONTAINER_FORCEINLINE void reserve(size_type new_cap)
|
||||
{
|
||||
if (this->capacity() < new_cap){
|
||||
this->priv_reserve_no_capacity(new_cap, alloc_version());
|
||||
@@ -1495,7 +1495,7 @@ class vector
|
||||
//! <b>Throws</b>: If memory allocation throws, or T's copy/move constructor throws.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to size().
|
||||
void shrink_to_fit()
|
||||
BOOST_CONTAINER_FORCEINLINE void shrink_to_fit()
|
||||
{ this->priv_shrink_to_fit(alloc_version()); }
|
||||
|
||||
//////////////////////////////////////////////
|
||||
@@ -1722,7 +1722,7 @@ class vector
|
||||
//!
|
||||
//! <b>Complexity</b>: Amortized constant time.
|
||||
template<class ...Args>
|
||||
void emplace_back(BOOST_FWD_REF(Args)...args)
|
||||
BOOST_CONTAINER_FORCEINLINE void emplace_back(BOOST_FWD_REF(Args)...args)
|
||||
{
|
||||
if (BOOST_LIKELY(this->room_enough())){
|
||||
//There is more memory, just construct a new object at the end
|
||||
@@ -1745,7 +1745,7 @@ class vector
|
||||
//!
|
||||
//! <b>Note</b>: Non-standard extension.
|
||||
template<class ...Args>
|
||||
bool stable_emplace_back(BOOST_FWD_REF(Args)...args)
|
||||
BOOST_CONTAINER_FORCEINLINE bool stable_emplace_back(BOOST_FWD_REF(Args)...args)
|
||||
{
|
||||
const bool is_room_enough = this->room_enough() || (alloc_version::value == 2 && this->m_holder.try_expand_fwd(1u));
|
||||
if (BOOST_LIKELY(is_room_enough)){
|
||||
@@ -1780,7 +1780,7 @@ class vector
|
||||
|
||||
#define BOOST_CONTAINER_VECTOR_EMPLACE_CODE(N) \
|
||||
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
|
||||
void emplace_back(BOOST_MOVE_UREF##N)\
|
||||
BOOST_CONTAINER_FORCEINLINE void emplace_back(BOOST_MOVE_UREF##N)\
|
||||
{\
|
||||
if (BOOST_LIKELY(this->room_enough())){\
|
||||
allocator_traits_type::construct (this->m_holder.alloc()\
|
||||
@@ -1795,7 +1795,7 @@ class vector
|
||||
}\
|
||||
\
|
||||
BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
|
||||
bool stable_emplace_back(BOOST_MOVE_UREF##N)\
|
||||
BOOST_CONTAINER_FORCEINLINE bool stable_emplace_back(BOOST_MOVE_UREF##N)\
|
||||
{\
|
||||
const bool is_room_enough = this->room_enough() || (alloc_version::value == 2 && this->m_holder.try_expand_fwd(1u));\
|
||||
if (BOOST_LIKELY(is_room_enough)){\
|
||||
@@ -1837,7 +1837,7 @@ class vector
|
||||
//! <b>Complexity</b>: Amortized constant time.
|
||||
void push_back(T &&x);
|
||||
#else
|
||||
BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back)
|
||||
BOOST_CONTAINER_FORCEINLINE BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back)
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||
|
||||
Reference in New Issue
Block a user