Introduced BOOST_CONTAINER_FORCEINLINE so that mandatory inlining can be disabled selectively

This commit is contained in:
Ion Gaztañaga
2015-12-24 10:22:38 +01:00
parent a3262c0ae7
commit 75f7c8fa73
9 changed files with 211 additions and 187 deletions
+23 -27
View File
@@ -41,29 +41,29 @@ class static_storage_allocator
public:
typedef T value_type;
static_storage_allocator() BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE static_storage_allocator() BOOST_NOEXCEPT_OR_NOTHROW
{}
static_storage_allocator(const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE static_storage_allocator(const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{}
static_storage_allocator & operator=(const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE static_storage_allocator & operator=(const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{ return *this; }
T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
{ return const_cast<T*>(static_cast<const T*>(static_cast<const void*>(&storage))); }
T* internal_storage() BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE T* internal_storage() BOOST_NOEXCEPT_OR_NOTHROW
{ return static_cast<T*>(static_cast<void*>(&storage)); }
static const std::size_t internal_capacity = N;
typedef boost::container::container_detail::version_type<static_storage_allocator, 0> version;
friend bool operator==(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE friend bool operator==(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{ return false; }
friend bool operator!=(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE friend bool operator!=(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW
{ return true; }
private:
@@ -143,7 +143,7 @@ public:
//!
//! @par Complexity
//! Constant O(1).
static_vector() BOOST_NOEXCEPT_OR_NOTHROW
BOOST_CONTAINER_FORCEINLINE static_vector() BOOST_NOEXCEPT_OR_NOTHROW
: base_t()
{}
@@ -158,7 +158,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
explicit static_vector(size_type count)
BOOST_CONTAINER_FORCEINLINE explicit static_vector(size_type count)
: base_t(count)
{}
@@ -176,7 +176,7 @@ public:
//!
//! @par Note
//! Non-standard extension
static_vector(size_type count, default_init_t)
BOOST_CONTAINER_FORCEINLINE static_vector(size_type count, default_init_t)
: base_t(count, default_init_t())
{}
@@ -192,7 +192,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector(size_type count, value_type const& value)
BOOST_CONTAINER_FORCEINLINE static_vector(size_type count, value_type const& value)
: base_t(count, value)
{}
@@ -211,7 +211,7 @@ public:
//! @par Complexity
//! Linear O(N).
template <typename Iterator>
static_vector(Iterator first, Iterator last)
BOOST_CONTAINER_FORCEINLINE static_vector(Iterator first, Iterator last)
: base_t(first, last)
{}
@@ -228,7 +228,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector(std::initializer_list<value_type> il)
BOOST_CONTAINER_FORCEINLINE static_vector(std::initializer_list<value_type> il)
: base_t(il)
{}
#endif
@@ -242,7 +242,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector(static_vector const& other)
BOOST_CONTAINER_FORCEINLINE static_vector(static_vector const& other)
: base_t(other)
{}
@@ -258,7 +258,7 @@ public:
//! @par Complexity
//! Linear O(N).
template <std::size_t C>
static_vector(static_vector<value_type, C> const& other)
BOOST_CONTAINER_FORCEINLINE static_vector(static_vector<value_type, C> const& other)
: base_t(other)
{}
@@ -272,7 +272,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector(BOOST_RV_REF(static_vector) other)
BOOST_CONTAINER_FORCEINLINE static_vector(BOOST_RV_REF(static_vector) other)
: base_t(BOOST_MOVE_BASE(base_t, other))
{}
@@ -289,7 +289,7 @@ public:
//! @par Complexity
//! Linear O(N).
template <std::size_t C>
static_vector(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other)
BOOST_CONTAINER_FORCEINLINE static_vector(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other)
: base_t(BOOST_MOVE_BASE(typename static_vector<value_type BOOST_MOVE_I C>::base_t, other))
{}
@@ -302,7 +302,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector & operator=(BOOST_COPY_ASSIGN_REF(static_vector) other)
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(BOOST_COPY_ASSIGN_REF(static_vector) other)
{
return static_cast<static_vector&>(base_t::operator=(static_cast<base_t const&>(other)));
}
@@ -317,7 +317,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector & operator=(std::initializer_list<value_type> il)
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(std::initializer_list<value_type> il)
{ return static_cast<static_vector&>(base_t::operator=(il)); }
#endif
@@ -333,7 +333,7 @@ public:
//! @par Complexity
//! Linear O(N).
template <std::size_t C>
static_vector & operator=(static_vector<value_type, C> const& other)
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(static_vector<value_type, C> const& other)
{
return static_cast<static_vector&>(base_t::operator=
(static_cast<typename static_vector<value_type, C>::base_t const&>(other)));
@@ -349,7 +349,7 @@ public:
//!
//! @par Complexity
//! Linear O(N).
static_vector & operator=(BOOST_RV_REF(static_vector) other)
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(BOOST_RV_REF(static_vector) other)
{
return static_cast<static_vector&>(base_t::operator=(BOOST_MOVE_BASE(base_t, other)));
}
@@ -367,7 +367,7 @@ public:
//! @par Complexity
//! Linear O(N).
template <std::size_t C>
static_vector & operator=(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other)
BOOST_CONTAINER_FORCEINLINE static_vector & operator=(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other)
{
return static_cast<static_vector&>(base_t::operator=
(BOOST_MOVE_BASE(typename static_vector<value_type BOOST_MOVE_I C>::base_t, other)));
@@ -578,7 +578,6 @@ public:
template <typename Iterator>
iterator insert(const_iterator p, Iterator first, Iterator last);
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! @pre
//! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>.
//! @li <tt>distance(il.begin(), il.end()) <= capacity()</tt>
@@ -594,7 +593,6 @@ public:
//! @par Complexity
//! Linear O(N).
iterator insert(const_iterator p, std::initializer_list<value_type> il);
#endif
//! @pre \c p must be a valid iterator of \c *this in range <tt>[begin(), end())</tt>
//!
@@ -640,7 +638,6 @@ public:
template <typename Iterator>
void assign(Iterator first, Iterator last);
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
//! @pre <tt>distance(il.begin(), il.end()) <= capacity()</tt>
//!
//! @brief Assigns a range <tt>[il.begin(), il.end())</tt> of Values to this container.
@@ -653,7 +650,6 @@ public:
//! @par Complexity
//! Linear O(N).
void assign(std::initializer_list<value_type> il);
#endif
//! @pre <tt>count <= capacity()</tt>
//!
@@ -1095,7 +1091,7 @@ public:
bool empty() const BOOST_NOEXCEPT_OR_NOTHROW;
#else
friend void swap(static_vector &x, static_vector &y)
BOOST_CONTAINER_FORCEINLINE friend void swap(static_vector &x, static_vector &y)
{
x.swap(y);
}