Use BOOST_INTRUSIVE_STATIC_ASSERT instead of BOOST_STATIC_ASSERT to reduce library level and weight.

This commit is contained in:
Ion Gaztañaga committed 2024-01-02 01:42:05 +01:00
1 parent 60def75ac2
commit e84e9b7b2e
48 files changed
+240 -246

No files matched your search

+2 -3
View File
@@ -17,7 +17,6 @@
#include <boost/intrusive/avltree.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -523,7 +522,7 @@ class avl_set
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline avl_set()
: Base()
@@ -1018,7 +1017,7 @@ class avl_multiset
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline avl_multiset()
: Base()
+1 -2
View File
@@ -18,7 +18,6 @@
#include <boost/intrusive/detail/minimal_less_equal_header.hpp>
#include <boost/intrusive/detail/minimal_pair_header.hpp>
#include <boost/static_assert.hpp>
#include <boost/intrusive/avl_set_hook.hpp>
#include <boost/intrusive/detail/avltree_node.hpp>
#include <boost/intrusive/bstree.hpp>
@@ -533,7 +532,7 @@ class avltree
typedef typename Base::const_reverse_iterator const_reverse_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline avltree()
: Base()
+2 -3
View File
@@ -17,7 +17,6 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/bstree.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -520,7 +519,7 @@ class bs_set
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline bs_set()
: Base()
@@ -1014,7 +1013,7 @@ class bs_multiset
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline bs_multiset()
: Base()
+6 -7
View File
@@ -16,7 +16,6 @@
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/bs_set_hook.hpp>
#include <boost/intrusive/detail/tree_node.hpp>
@@ -113,7 +112,7 @@ struct bstbase3
static bstbase3 &get_tree_base_from_end_iterator(const const_iterator &end_iterator)
{
BOOST_STATIC_ASSERT(has_container_from_iterator);
BOOST_INTRUSIVE_STATIC_ASSERT(has_container_from_iterator);
node_ptr p = end_iterator.pointed_node();
header_holder_type* h = header_holder_type::get_holder(p);
holder_t *holder = get_parent_from_member<holder_t, header_holder_type>(h, &holder_t::root);
@@ -207,13 +206,13 @@ struct bstbase3
static iterator s_iterator_to(reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
return iterator (value_traits::to_node_ptr(value), const_value_traits_ptr());
}
static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
return const_iterator (value_traits::to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), const_value_traits_ptr());
}
@@ -666,7 +665,7 @@ class bstree_impl
static const bool safemode_or_autounlink = is_safe_autounlink<value_traits::link_mode>::value;
//Constant-time size is incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
BOOST_INTRUSIVE_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
protected:
@@ -1961,7 +1960,7 @@ class bstree_impl
//! functor a compilation error will be issued.
static void remove_node(reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!constant_time_size));
BOOST_INTRUSIVE_STATIC_ASSERT((!constant_time_size));
node_ptr to_remove(value_traits::to_node_ptr(value));
node_algorithms::unlink(to_remove);
BOOST_IF_CONSTEXPR(safemode_or_autounlink)
@@ -2184,7 +2183,7 @@ class bstree
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline bstree()
: Base()
@@ -27,7 +27,6 @@
#include <boost/intrusive/detail/assert.hpp>
#include <boost/intrusive/detail/node_holder.hpp>
#include <boost/intrusive/detail/algo_type.hpp>
#include <boost/static_assert.hpp>
namespace boost {
namespace intrusive {
@@ -202,13 +201,13 @@ class generic_hook
inline bool is_linked() const BOOST_NOEXCEPT
{
//is_linked() can be only used in safe-mode or auto-unlink
BOOST_STATIC_ASSERT(( hooktags::safemode_or_autounlink ));
BOOST_INTRUSIVE_STATIC_ASSERT(( hooktags::safemode_or_autounlink ));
return !node_algorithms::unique(this->this_ptr());
}
inline void unlink() BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink ));
BOOST_INTRUSIVE_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink ));
node_ptr n(this->this_ptr());
if(!node_algorithms::inited(n)){
node_algorithms::unlink(n);
@@ -26,8 +26,7 @@
#if defined(_MSC_VER)
#define BOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER
#include <boost/static_assert.hpp>
#endif
#endif
namespace boost {
namespace intrusive {
@@ -49,7 +48,7 @@ BOOST_INTRUSIVE_FORCEINLINE std::ptrdiff_t offset_from_pointer_to_member(const M
//MSVC ABI can use up to 3 int32 to represent pointer to member data
//with virtual base classes, in those cases there is no simple to
//obtain the address of the parent. So static assert to avoid runtime errors
BOOST_STATIC_ASSERT( sizeof(caster) == sizeof(int) );
BOOST_INTRUSIVE_STATIC_ASSERT( sizeof(caster) == sizeof(int) );
caster.ptr_to_member = ptr_to_member;
return std::ptrdiff_t(caster.offset);
@@ -27,7 +27,6 @@
#include <boost/intrusive/detail/std_fwd.hpp>
#include <boost/intrusive/detail/iiterator.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/static_assert.hpp>
namespace boost {
namespace intrusive {
@@ -72,7 +71,7 @@ class slist_iterator
inline explicit slist_iterator(node_ptr nodeptr)
: members_(nodeptr, const_value_traits_ptr())
{ BOOST_STATIC_ASSERT((stateful_value_traits == false)); }
{ BOOST_INTRUSIVE_STATIC_ASSERT((stateful_value_traits == false)); }
inline slist_iterator(const slist_iterator &other)
: members_(other.pointed_node(), other.get_value_traits())
@@ -84,4 +84,32 @@
# define BOOST_INTRUSIVE_CATCH_END }
#endif
#ifndef BOOST_NO_CXX11_STATIC_ASSERT
# ifndef BOOST_NO_CXX11_VARIADIC_MACROS
# define BOOST_INTRUSIVE_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__)
# else
# define BOOST_INTRUSIVE_STATIC_ASSERT( B ) static_assert(B, #B)
# endif
#else
namespace boost {
namespace intrusive {
namespace detail {
template<bool B>
struct STATIC_ASSERTION_FAILURE;
template<>
struct STATIC_ASSERTION_FAILURE<true>{};
template<unsigned> struct static_assert_test {};
}}}
#define BOOST_INTRUSIVE_STATIC_ASSERT(B) \
typedef ::boost::intrusive::detail::static_assert_test<\
(unsigned)sizeof(::boost::intrusive::detail::STATIC_ASSERTION_FAILURE<bool(B)>)>\
BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
#endif
#endif //#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
+9 -10
View File
@@ -60,7 +60,6 @@
//boost
#include <boost/intrusive/detail/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/move/adl_move_swap.hpp>
#include <boost/move/algo/detail/search.hpp>
@@ -2059,14 +2058,14 @@ struct hashdata_internal
static local_iterator s_local_iterator_to(reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
siterator sit(value_traits::to_node_ptr(value));
return local_iterator(sit, const_value_traits_ptr());
}
static const_local_iterator s_local_iterator_to(const_reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
siterator const sit = siterator
( pointer_traits<node_ptr>::const_cast_from
(value_traits::to_node_ptr(value))
@@ -2329,11 +2328,11 @@ class hashtable_impl
//Configuration error: compare_hash<> can't be specified without store_hash<>
//See documentation for more explanations
BOOST_STATIC_ASSERT((!compare_hash || store_hash));
BOOST_INTRUSIVE_STATIC_ASSERT((!compare_hash || store_hash));
//Configuration error: fasmod_buckets<> can't be specified with incremental<> or power_2_buckets<>
//See documentation for more explanations
BOOST_STATIC_ASSERT(!(fastmod_buckets && power_2_buckets));
BOOST_INTRUSIVE_STATIC_ASSERT(!(fastmod_buckets && power_2_buckets));
typedef typename internal_type::slist_node_ptr slist_node_ptr;
typedef typename pointer_traits
@@ -2360,9 +2359,9 @@ class hashtable_impl
static const bool safemode_or_autounlink = internal_type::safemode_or_autounlink;
//Constant-time size is incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
BOOST_INTRUSIVE_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
//Cache begin is incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(cache_begin && ((int)value_traits::link_mode == (int)auto_unlink)));
BOOST_INTRUSIVE_STATIC_ASSERT(!(cache_begin && ((int)value_traits::link_mode == (int)auto_unlink)));
/// @endcond
@@ -3571,7 +3570,7 @@ class hashtable_impl
bool incremental_rehash(bool grow = true)
{
//This function is only available for containers with incremental hashing
BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
BOOST_INTRUSIVE_STATIC_ASSERT(( incremental && power_2_buckets ));
const std::size_t split_idx = this->split_count();
const std::size_t bucket_cnt = this->bucket_count();
bool ret = false;
@@ -3636,7 +3635,7 @@ class hashtable_impl
bool incremental_rehash(const bucket_traits &new_bucket_traits) BOOST_NOEXCEPT
{
//This function is only available for containers with incremental hashing
BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
BOOST_INTRUSIVE_STATIC_ASSERT(( incremental && power_2_buckets ));
const bucket_ptr new_buckets = new_bucket_traits.bucket_begin();
const size_type new_bucket_count_stdszt = static_cast<SizeType>(new_bucket_traits.bucket_count() - bucket_overhead);
BOOST_INTRUSIVE_INVARIANT_ASSERT(sizeof(size_type) >= sizeof(std::size_t) || new_bucket_count_stdszt <= size_type(-1));
@@ -4334,7 +4333,7 @@ class hashtable
typedef typename Base::key_equal key_equal;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline explicit hashtable ( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
+5 -6
View File
@@ -37,7 +37,6 @@
#include <boost/intrusive/detail/algorithm.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#include <boost/intrusive/detail/value_functors.hpp>
#include <cstddef> //std::size_t, etc.
@@ -123,7 +122,7 @@ class list_impl
static const bool safemode_or_autounlink = is_safe_autounlink<value_traits::link_mode>::value;
//Constant-time size is incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(constant_time_size &&
BOOST_INTRUSIVE_STATIC_ASSERT(!(constant_time_size &&
((int)value_traits::link_mode == (int)auto_unlink)
));
@@ -1272,7 +1271,7 @@ class list_impl
//! is stateless.
static iterator s_iterator_to(reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(value_traits::to_node_ptr(value)));
return iterator(value_traits::to_node_ptr(value), const_value_traits_ptr());
}
@@ -1290,7 +1289,7 @@ class list_impl
//! is stateless.
static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
reference r =*detail::uncast(pointer_traits<const_pointer>::pointer_to(value));
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(value_traits::to_node_ptr(r)));
return const_iterator(value_traits::to_node_ptr(r), const_value_traits_ptr());
@@ -1394,7 +1393,7 @@ class list_impl
private:
static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((has_container_from_iterator));
BOOST_INTRUSIVE_STATIC_ASSERT((has_container_from_iterator));
node_ptr p = end_iterator.pointed_node();
header_holder_type* h = header_holder_type::get_holder(p);
root_plus_size* r = detail::parent_from_member
@@ -1466,7 +1465,7 @@ class list
#endif
>::type Base;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_MOVABLE_BUT_NOT_COPYABLE(list)
public:
+3 -3
View File
@@ -14,7 +14,7 @@
#define BOOST_INTRUSIVE_PACK_OPTIONS_HPP
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/detail/workaround.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
@@ -338,7 +338,7 @@ struct pack_options
//!
//! typedef pack_options< empty_default, typename my_pointer<void*> >::type::my_pointer_type type;
//!
//! BOOST_STATIC_ASSERT(( boost::is_same<type, void>::value ));
//! BOOST_INTRUSIVE_STATIC_ASSERT(( boost::is_same<type, void>::value ));
//!
//! \endcode
#define BOOST_INTRUSIVE_OPTION_TYPE(OPTION_NAME, TYPE, TYPEDEF_EXPR, TYPEDEF_NAME)
@@ -368,7 +368,7 @@ struct pack_options
//!
//! const bool is_incremental = pack_options< empty_default, incremental<true> >::type::is_incremental;
//!
//! BOOST_STATIC_ASSERT(( is_incremental == true ));
//! BOOST_INTRUSIVE_STATIC_ASSERT(( is_incremental == true ));
//!
//! \endcode
#define BOOST_INTRUSIVE_OPTION_CONSTANT(OPTION_NAME, TYPE, VALUE, CONSTANT_NAME)
+1 -2
View File
@@ -29,7 +29,6 @@
#include <boost/intrusive/link_mode.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -536,7 +535,7 @@ class rbtree
typedef typename Base::const_reverse_iterator const_reverse_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline rbtree()
: Base()
+2 -3
View File
@@ -19,7 +19,6 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/rbtree.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -523,7 +522,7 @@ class set
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline set()
: Base()
@@ -1018,7 +1017,7 @@ class multiset
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline multiset()
: Base()
+2 -3
View File
@@ -16,7 +16,6 @@
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/sgtree.hpp>
#include <boost/static_assert.hpp>
#include <boost/move/utility_core.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
@@ -532,7 +531,7 @@ class sg_set
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline sg_set()
: Base()
@@ -1039,7 +1038,7 @@ class sg_multiset
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline sg_multiset()
: Base()
+3 -4
View File
@@ -21,7 +21,6 @@
#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/intrusive/bs_set_hook.hpp>
#include <boost/intrusive/bstree.hpp>
#include <boost/intrusive/detail/tree_node.hpp>
@@ -275,7 +274,7 @@ class sgtree_impl
typedef typename alpha_traits::multiply_by_alpha_t multiply_by_alpha_t;
BOOST_MOVABLE_BUT_NOT_COPYABLE(sgtree_impl)
BOOST_STATIC_ASSERT(((int)value_traits::link_mode != (int)auto_unlink));
BOOST_INTRUSIVE_STATIC_ASSERT(((int)value_traits::link_mode != (int)auto_unlink));
enum { safemode_or_autounlink =
(int)value_traits::link_mode == (int)auto_unlink ||
@@ -914,7 +913,7 @@ class sgtree_impl
{
//The alpha factor CAN't be changed if the fixed, floating operation-less
//1/sqrt(2) alpha factor option is activated
BOOST_STATIC_ASSERT((floating_point));
BOOST_INTRUSIVE_STATIC_ASSERT((floating_point));
BOOST_INTRUSIVE_INVARIANT_ASSERT((new_alpha > 0.5f && new_alpha < 1.0f));
if(new_alpha >= 0.5f && new_alpha < 1.0f){
float old_alpha = this->get_alpha_traits().get_alpha();
@@ -1018,7 +1017,7 @@ class sgtree
typedef typename Base::const_reverse_iterator const_reverse_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline sgtree()
: Base()
+14 -15
View File
@@ -41,7 +41,6 @@
#include <boost/intrusive/detail/node_cloner_disposer.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#include <cstddef> //std::size_t
@@ -166,11 +165,11 @@ class slist_impl
static const bool safemode_or_autounlink = is_safe_autounlink<value_traits::link_mode>::value;
//Constant-time size is incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
BOOST_INTRUSIVE_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
//Linear singly linked lists are incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(linear && ((int)value_traits::link_mode == (int)auto_unlink)));
BOOST_INTRUSIVE_STATIC_ASSERT(!(linear && ((int)value_traits::link_mode == (int)auto_unlink)));
//A list with cached last node is incompatible with auto-unlink hooks!
BOOST_STATIC_ASSERT(!(cache_last && ((int)value_traits::link_mode == (int)auto_unlink)));
BOOST_INTRUSIVE_STATIC_ASSERT(!(cache_last && ((int)value_traits::link_mode == (int)auto_unlink)));
inline node_ptr get_end_node()
{ return node_algorithms::end_node(this->get_root_node()); }
@@ -449,7 +448,7 @@ class slist_impl
//! This function is only available is cache_last<> is true.
void push_back(reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((cache_last));
BOOST_INTRUSIVE_STATIC_ASSERT((cache_last));
node_ptr n = priv_value_traits().to_node_ptr(value);
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(n));
node_algorithms::link_after(this->get_last_node(), n);
@@ -522,7 +521,7 @@ class slist_impl
//! This function is only available is cache_last<> is true.
reference back() BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((cache_last));
BOOST_INTRUSIVE_STATIC_ASSERT((cache_last));
return *this->priv_value_traits().to_value_ptr(this->get_last_node());
}
@@ -536,7 +535,7 @@ class slist_impl
//! This function is only available is cache_last<> is true.
inline const_reference back() const BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((cache_last));
BOOST_INTRUSIVE_STATIC_ASSERT((cache_last));
return *this->priv_value_traits().to_value_ptr(this->get_last_node());
}
@@ -1061,7 +1060,7 @@ class slist_impl
static iterator s_insert_after(const_iterator const prev_p, reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
BOOST_INTRUSIVE_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
node_ptr const n = value_traits::to_node_ptr(value);
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::inited(n));
node_algorithms::link_after(prev_p.pointed_node(), n);
@@ -1071,7 +1070,7 @@ class slist_impl
template<class Disposer>
static iterator s_erase_after_and_dispose(const_iterator prev, Disposer disposer) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
BOOST_INTRUSIVE_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
const_iterator it(prev);
++it;
node_ptr to_erase(it.pointed_node());
@@ -1087,7 +1086,7 @@ class slist_impl
template<class Disposer>
static iterator s_erase_after_and_dispose(const_iterator before_f, const_iterator l, Disposer disposer) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
BOOST_INTRUSIVE_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
node_ptr bfp(before_f.pointed_node()), lp(l.pointed_node());
node_ptr fp(node_traits::get_next(bfp));
node_algorithms::unlink_after(bfp, lp);
@@ -1754,7 +1753,7 @@ class slist_impl
//! is stateless.
static iterator s_iterator_to(reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
return iterator (value_traits::to_node_ptr(value), const_value_traits_ptr());
}
@@ -1771,7 +1770,7 @@ class slist_impl
//! is stateless.
static const_iterator s_iterator_to(const_reference value) BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT((!stateful_value_traits));
BOOST_INTRUSIVE_STATIC_ASSERT((!stateful_value_traits));
reference r =*detail::uncast(pointer_traits<const_pointer>::pointer_to(value));
return const_iterator(value_traits::to_node_ptr(r), const_value_traits_ptr());
}
@@ -2112,8 +2111,8 @@ class slist_impl
{
//Obtaining the container from the end iterator is not possible with linear
//singly linked lists (because "end" is represented by the null pointer)
BOOST_STATIC_ASSERT(!linear);
BOOST_STATIC_ASSERT((has_container_from_iterator));
BOOST_INTRUSIVE_STATIC_ASSERT(!linear);
BOOST_INTRUSIVE_STATIC_ASSERT((has_container_from_iterator));
node_ptr p = end_iterator.pointed_node();
header_holder_type* h = header_holder_type::get_holder(p);
header_holder_plus_last_t* hpl = detail::parent_from_member< header_holder_plus_last_t, header_holder_type>
@@ -2185,7 +2184,7 @@ class slist
#endif
>::type Base;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_MOVABLE_BUT_NOT_COPYABLE(slist)
public:
+2 -3
View File
@@ -17,7 +17,6 @@
#include <boost/intrusive/splaytree.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -544,7 +543,7 @@ class splay_set
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline splay_set()
: Base()
@@ -1055,7 +1054,7 @@ class splay_multiset
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline splay_multiset()
: Base()
+1 -2
View File
@@ -18,7 +18,6 @@
#include <boost/intrusive/detail/minimal_less_equal_header.hpp>
#include <boost/intrusive/detail/minimal_pair_header.hpp> //std::pair
#include <boost/static_assert.hpp>
#include <boost/intrusive/bstree.hpp>
#include <boost/intrusive/detail/tree_node.hpp>
#include <boost/intrusive/detail/mpl.hpp>
@@ -611,7 +610,7 @@ class splaytree
typedef typename Base::const_reverse_iterator const_reverse_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline splaytree()
: Base()
+1 -2
View File
@@ -29,7 +29,6 @@
#include <boost/intrusive/detail/node_cloner_disposer.hpp>
#include <boost/intrusive/detail/key_nodeptr_comp.hpp>
#include <boost/static_assert.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/move/adl_move_swap.hpp>
@@ -1313,7 +1312,7 @@ class treap
typedef typename Base::const_reverse_iterator const_reverse_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline treap()
: Base()
+2 -3
View File
@@ -17,7 +17,6 @@
#include <boost/intrusive/treap.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -540,7 +539,7 @@ class treap_set
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline treap_set()
: Base()
@@ -1055,7 +1054,7 @@ class treap_multiset
typedef typename Base::const_iterator const_iterator;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
inline treap_multiset()
: Base()
+2 -3
View File
@@ -17,7 +17,6 @@
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/hashtable.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
@@ -488,7 +487,7 @@ class unordered_set
>::type Base;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_set)
public:
@@ -943,7 +942,7 @@ class unordered_multiset
#endif
>::type Base;
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_INTRUSIVE_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
BOOST_MOVABLE_BUT_NOT_COPYABLE(unordered_multiset)
public: