Sync from upstream.

This commit is contained in:
Rene Rivera
2024-06-10 21:40:52 -05:00
51 changed files with 281 additions and 271 deletions

View File

@@ -328,15 +328,15 @@ jobs:
#------------------ #------------------
# Macos 11, clang # Macos 11, clang
- toolset: clang - toolset: clang
cxxstd: "03,11,14,17,2a" cxxstd: "11,14,17,2a"
os: macos-11 os: macos-11
# Macos 12, clang # Macos 12, clang
- toolset: clang - toolset: clang
cxxstd: "03,11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
os: macos-12 os: macos-12
# Macos 13, clang # Macos 13, clang
- toolset: clang - toolset: clang
cxxstd: "03,11,14,17,20,2b" cxxstd: "11,14,17,20,2b"
os: macos-13 os: macos-13
timeout-minutes: 180 timeout-minutes: 180

View File

@@ -1413,9 +1413,12 @@ use [*Boost.Container]? There are several reasons for that:
* Fixed bugs/issues: * Fixed bugs/issues:
* [@https://github.com/boostorg/container/issues/280 GitHub #280: ['"Several containers don't support non-movable types when move assigning"]]. * [@https://github.com/boostorg/container/issues/280 GitHub #280: ['"Several containers don't support non-movable types when move assigning"]].
* [@https://github.com/boostorg/container/issues/279 GitHub #279: ['"small_vector cannot go back to use stack space"]].
* [@https://github.com/boostorg/container/issues/277 GitHub #277: ['"Remove dep on boost::static_assert"]]. * [@https://github.com/boostorg/container/issues/277 GitHub #277: ['"Remove dep on boost::static_assert"]].
* [@https://github.com/boostorg/container/issues/275 GitHub #275: ['"Compilation fails if custom key comparison is used"]].
* [@https://github.com/boostorg/container/issues/273 GitHub #273: ['"flat_map/vector crashes on appends (memory corruption)"]]. * [@https://github.com/boostorg/container/issues/273 GitHub #273: ['"flat_map/vector crashes on appends (memory corruption)"]].
* [@https://github.com/boostorg/container/issues/269 GitHub #269: ['"flat_multimap::emplace not sorting elements under GCC"]]. * [@https://github.com/boostorg/container/issues/269 GitHub #269: ['"flat_multimap::emplace not sorting elements under GCC"]].
* [@https://github.com/boostorg/container/issues/269 GitHub #269: ['"flat_multimap::emplace not sorting elements under GCC"]].
[endsect] [endsect]

View File

@@ -71,10 +71,10 @@ class adaptive_pool
BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version) BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version)
> self_t; > self_t;
static const std::size_t nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock;
static const std::size_t max_free_blocks = MaxFreeBlocks; BOOST_STATIC_CONSTEXPR std::size_t max_free_blocks = MaxFreeBlocks;
static const std::size_t overhead_percent = OverheadPercent; BOOST_STATIC_CONSTEXPR std::size_t overhead_percent = OverheadPercent;
static const std::size_t real_nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t real_nodes_per_block = NodesPerBlock;
BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2))); BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2)));
@@ -384,10 +384,10 @@ class private_adaptive_pool
BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version) BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version)
> self_t; > self_t;
static const std::size_t nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock;
static const std::size_t max_free_blocks = MaxFreeBlocks; BOOST_STATIC_CONSTEXPR std::size_t max_free_blocks = MaxFreeBlocks;
static const std::size_t overhead_percent = OverheadPercent; BOOST_STATIC_CONSTEXPR std::size_t overhead_percent = OverheadPercent;
static const std::size_t real_nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t real_nodes_per_block = NodesPerBlock;
BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2))); BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2)));

View File

@@ -115,7 +115,7 @@ class allocator
template<class T2, unsigned int Version2, unsigned int AllocationDisableMask2> template<class T2, unsigned int Version2, unsigned int AllocationDisableMask2>
allocator& operator=(const allocator<T2, Version2, AllocationDisableMask2>&); allocator& operator=(const allocator<T2, Version2, AllocationDisableMask2>&);
static const unsigned int ForbiddenMask = BOOST_STATIC_CONSTEXPR unsigned int ForbiddenMask =
BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ; BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ;
//The mask can't disable all the allocation types //The mask can't disable all the allocation types

View File

@@ -240,19 +240,19 @@ namespace dtl {
//supporting rvalue references //supporting rvalue references
template<class Allocator> template<class Allocator>
struct is_std_allocator struct is_std_allocator
{ static const bool value = false; }; { BOOST_STATIC_CONSTEXPR bool value = false; };
template<class T> template<class T>
struct is_std_allocator< std::allocator<T> > struct is_std_allocator< std::allocator<T> >
{ static const bool value = true; }; { BOOST_STATIC_CONSTEXPR bool value = true; };
template<class T, class Options> template<class T, class Options>
struct is_std_allocator< small_vector_allocator<T, std::allocator<T>, Options > > struct is_std_allocator< small_vector_allocator<T, std::allocator<T>, Options > >
{ static const bool value = true; }; { BOOST_STATIC_CONSTEXPR bool value = true; };
template<class Allocator> template<class Allocator>
struct is_not_std_allocator struct is_not_std_allocator
{ static const bool value = !is_std_allocator<Allocator>::value; }; { BOOST_STATIC_CONSTEXPR bool value = !is_std_allocator<Allocator>::value; };
BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(pointer) BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(pointer)
BOOST_INTRUSIVE_INSTANTIATE_EVAL_DEFAULT_TYPE_TMPLT(const_pointer) BOOST_INTRUSIVE_INSTANTIATE_EVAL_DEFAULT_TYPE_TMPLT(const_pointer)
@@ -498,7 +498,7 @@ struct allocator_traits
template <class T, class ...Args> template <class T, class ...Args>
inline static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args) inline static void construct(Allocator & a, T* p, BOOST_FWD_REF(Args)... args)
{ {
static const bool value = ::boost::move_detail::and_ BOOST_STATIC_CONSTEXPR bool value = ::boost::move_detail::and_
< dtl::is_not_std_allocator<Allocator> < dtl::is_not_std_allocator<Allocator>
, boost::container::dtl::has_member_function_callable_with_construct , boost::container::dtl::has_member_function_callable_with_construct
< Allocator, T*, Args... > < Allocator, T*, Args... >
@@ -567,7 +567,7 @@ struct allocator_traits
template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\ template<class T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
inline static void construct(Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\ inline static void construct(Allocator &a, T *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
{\ {\
static const bool value = ::boost::move_detail::and_ \ BOOST_STATIC_CONSTEXPR bool value = ::boost::move_detail::and_ \
< dtl::is_not_std_allocator<Allocator> \ < dtl::is_not_std_allocator<Allocator> \
, boost::container::dtl::has_member_function_callable_with_construct \ , boost::container::dtl::has_member_function_callable_with_construct \
< Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_FWD_T##N > \ < Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_FWD_T##N > \

View File

@@ -15,6 +15,8 @@
# include <boost/config.hpp> # include <boost/config.hpp>
#endif #endif
#include <boost/container/detail/workaround.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE) #if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once # pragma once
#endif #endif
@@ -277,10 +279,10 @@ class basic_string;
typedef basic_string <char> string; typedef basic_string <char> string;
typedef basic_string<wchar_t> wstring; typedef basic_string<wchar_t> wstring;
static const std::size_t ADP_nodes_per_block = 256u; BOOST_STATIC_CONSTEXPR std::size_t ADP_nodes_per_block = 256u;
static const std::size_t ADP_max_free_blocks = 2u; BOOST_STATIC_CONSTEXPR std::size_t ADP_max_free_blocks = 2u;
static const std::size_t ADP_overhead_percent = 1u; BOOST_STATIC_CONSTEXPR std::size_t ADP_overhead_percent = 1u;
static const std::size_t ADP_only_alignment = 0u; BOOST_STATIC_CONSTEXPR std::size_t ADP_only_alignment = 0u;
template < class T template < class T
, std::size_t NodesPerBlock = ADP_nodes_per_block , std::size_t NodesPerBlock = ADP_nodes_per_block
@@ -295,7 +297,7 @@ template < class T
, unsigned int AllocationDisableMask = 0> , unsigned int AllocationDisableMask = 0>
class allocator; class allocator;
static const std::size_t NodeAlloc_nodes_per_block = 256u; BOOST_STATIC_CONSTEXPR std::size_t NodeAlloc_nodes_per_block = 256u;
template template
< class T < class T
@@ -332,7 +334,7 @@ struct ordered_range_t
//! Value used to tag that the input range is //! Value used to tag that the input range is
//! guaranteed to be ordered //! guaranteed to be ordered
static const ordered_range_t ordered_range = ordered_range_t(); BOOST_CONTAINER_CONSTANT_VAR ordered_range_t ordered_range = ordered_range_t();
//! Type used to tag that the input range is //! Type used to tag that the input range is
//! guaranteed to be ordered and unique //! guaranteed to be ordered and unique
@@ -342,7 +344,7 @@ struct ordered_unique_range_t
//! Value used to tag that the input range is //! Value used to tag that the input range is
//! guaranteed to be ordered and unique //! guaranteed to be ordered and unique
static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t(); BOOST_CONTAINER_CONSTANT_VAR ordered_unique_range_t ordered_unique_range = ordered_unique_range_t();
//! Type used to tag that the inserted values //! Type used to tag that the inserted values
//! should be default initialized //! should be default initialized
@@ -351,7 +353,7 @@ struct default_init_t
//! Value used to tag that the inserted values //! Value used to tag that the inserted values
//! should be default initialized //! should be default initialized
static const default_init_t default_init = default_init_t(); BOOST_CONTAINER_CONSTANT_VAR default_init_t default_init = default_init_t();
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
//! Type used to tag that the inserted values //! Type used to tag that the inserted values
@@ -361,7 +363,7 @@ struct value_init_t
//! Value used to tag that the inserted values //! Value used to tag that the inserted values
//! should be value initialized //! should be value initialized
static const value_init_t value_init = value_init_t(); BOOST_CONTAINER_CONSTANT_VAR value_init_t value_init = value_init_t();
namespace container_detail_really_deep_namespace { namespace container_detail_really_deep_namespace {

View File

@@ -68,16 +68,16 @@ template <class T>
struct deque_value_traits struct deque_value_traits
{ {
typedef T value_type; typedef T value_type;
static const bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value;
static const bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move<value_type>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move<value_type>::value;
}; };
template<class T, std::size_t BlockBytes, std::size_t BlockSize> template<class T, std::size_t BlockBytes, std::size_t BlockSize>
struct deque_block_size struct deque_block_size
{ {
BOOST_CONTAINER_STATIC_ASSERT_MSG(!(BlockBytes && BlockSize), "BlockBytes and BlockSize can't be specified at the same time"); BOOST_CONTAINER_STATIC_ASSERT_MSG(!(BlockBytes && BlockSize), "BlockBytes and BlockSize can't be specified at the same time");
static const std::size_t block_bytes = BlockBytes ? BlockBytes : 512u; BOOST_STATIC_CONSTEXPR std::size_t block_bytes = BlockBytes ? BlockBytes : 512u;
static const std::size_t value = BlockSize ? BlockSize : (sizeof(T) < block_bytes ? (block_bytes/sizeof(T)) : std::size_t(1)); BOOST_STATIC_CONSTEXPR std::size_t value = BlockSize ? BlockSize : (sizeof(T) < block_bytes ? (block_bytes/sizeof(T)) : std::size_t(1));
}; };
namespace dtl { namespace dtl {
@@ -2870,7 +2870,7 @@ struct has_trivial_destructor_after_move<boost::container::deque<T, Allocator, O
{ {
typedef typename boost::container::deque<T, Allocator, Options>::allocator_type allocator_type; typedef typename boost::container::deque<T, Allocator, Options>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<pointer>::value;
}; };

View File

@@ -76,7 +76,7 @@ class private_adaptive_node_pool
private_adaptive_node_pool &operator=(const private_adaptive_node_pool &); private_adaptive_node_pool &operator=(const private_adaptive_node_pool &);
public: public:
static const std::size_t nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock;
//!Constructor. Never throws //!Constructor. Never throws
private_adaptive_node_pool() private_adaptive_node_pool()

View File

@@ -49,10 +49,10 @@ namespace container {
namespace adaptive_pool_flag { namespace adaptive_pool_flag {
static const unsigned int none = 0u; BOOST_CONTAINER_CONSTANT_VAR unsigned int none = 0u;
static const unsigned int align_only = 1u << 0u; BOOST_CONTAINER_CONSTANT_VAR unsigned int align_only = 1u << 0u;
static const unsigned int size_ordered = 1u << 1u; BOOST_CONTAINER_CONSTANT_VAR unsigned int size_ordered = 1u << 1u;
static const unsigned int address_ordered = 1u << 2u; BOOST_CONTAINER_CONSTANT_VAR unsigned int address_ordered = 1u << 2u;
} //namespace adaptive_pool_flag{ } //namespace adaptive_pool_flag{
@@ -213,11 +213,11 @@ template<class MultiallocationChain, class VoidPointer, class SizeType, unsigned
struct adaptive_pool_types struct adaptive_pool_types
{ {
typedef VoidPointer void_pointer; typedef VoidPointer void_pointer;
static const unsigned ordered = (Flags & (adaptive_pool_flag::size_ordered | adaptive_pool_flag::address_ordered)); BOOST_STATIC_CONSTEXPR unsigned ordered = (Flags & (adaptive_pool_flag::size_ordered | adaptive_pool_flag::address_ordered));
typedef block_container_traits<VoidPointer, SizeType, ordered> block_container_traits_t; typedef block_container_traits<VoidPointer, SizeType, ordered> block_container_traits_t;
typedef typename block_container_traits_t::hook_t hook_t; typedef typename block_container_traits_t::hook_t hook_t;
typedef hdr_offset_holder_t<SizeType> hdr_offset_holder; typedef hdr_offset_holder_t<SizeType> hdr_offset_holder;
static const unsigned int order_flags = Flags & (adaptive_pool_flag::size_ordered | adaptive_pool_flag::address_ordered); BOOST_STATIC_CONSTEXPR unsigned int order_flags = Flags & (adaptive_pool_flag::size_ordered | adaptive_pool_flag::address_ordered);
typedef MultiallocationChain free_nodes_t; typedef MultiallocationChain free_nodes_t;
struct block_info_t struct block_info_t
@@ -253,11 +253,11 @@ template< std::size_t alignment
, std::size_t overhead_percent> , std::size_t overhead_percent>
struct candidate_power_of_2_ct_helper struct candidate_power_of_2_ct_helper
{ {
static const std::size_t hdr_subblock_elements_alone = (alignment - hdr_size - payload_per_allocation)/real_node_size; BOOST_STATIC_CONSTEXPR std::size_t hdr_subblock_elements_alone = (alignment - hdr_size - payload_per_allocation)/real_node_size;
static const std::size_t hdr_subblock_elements_first = (alignment - hdr_size - payload_per_allocation)/real_node_size; BOOST_STATIC_CONSTEXPR std::size_t hdr_subblock_elements_first = (alignment - hdr_size - payload_per_allocation)/real_node_size;
static const std::size_t elements_per_b_subblock_mid = (alignment - hdr_offset_size)/real_node_size; BOOST_STATIC_CONSTEXPR std::size_t elements_per_b_subblock_mid = (alignment - hdr_offset_size)/real_node_size;
static const std::size_t elements_per_b_subblock_end = (alignment - hdr_offset_size - payload_per_allocation)/real_node_size; BOOST_STATIC_CONSTEXPR std::size_t elements_per_b_subblock_end = (alignment - hdr_offset_size - payload_per_allocation)/real_node_size;
static const std::size_t num_b_subblock = BOOST_STATIC_CONSTEXPR std::size_t num_b_subblock =
hdr_subblock_elements_alone >= min_elements_per_block hdr_subblock_elements_alone >= min_elements_per_block
? 0 ? 0
: ( ((hdr_subblock_elements_first + elements_per_b_subblock_end) >= min_elements_per_block) : ( ((hdr_subblock_elements_first + elements_per_b_subblock_end) >= min_elements_per_block)
@@ -266,18 +266,18 @@ struct candidate_power_of_2_ct_helper
) )
; ;
static const std::size_t num_b_subblock_mid = (num_b_subblock > 1) ? (num_b_subblock - 1) : 0; BOOST_STATIC_CONSTEXPR std::size_t num_b_subblock_mid = (num_b_subblock > 1) ? (num_b_subblock - 1) : 0;
static const std::size_t total_nodes = (num_b_subblock == 0) BOOST_STATIC_CONSTEXPR std::size_t total_nodes = (num_b_subblock == 0)
? hdr_subblock_elements_alone ? hdr_subblock_elements_alone
: ( (num_b_subblock == 1) : ( (num_b_subblock == 1)
? (hdr_subblock_elements_first + elements_per_b_subblock_end) ? (hdr_subblock_elements_first + elements_per_b_subblock_end)
: (hdr_subblock_elements_first + num_b_subblock_mid*elements_per_b_subblock_mid + elements_per_b_subblock_end) : (hdr_subblock_elements_first + num_b_subblock_mid*elements_per_b_subblock_mid + elements_per_b_subblock_end)
) )
; ;
static const std::size_t total_data = total_nodes*real_node_size; BOOST_STATIC_CONSTEXPR std::size_t total_data = total_nodes*real_node_size;
static const std::size_t total_size = alignment*(num_b_subblock+1); BOOST_STATIC_CONSTEXPR std::size_t total_size = alignment*(num_b_subblock+1);
static const bool overhead_satisfied = (total_size - total_data)*100/total_size < overhead_percent; BOOST_STATIC_CONSTEXPR bool overhead_satisfied = (total_size - total_data)*100/total_size < overhead_percent;
}; };
template< std::size_t initial_alignment template< std::size_t initial_alignment
@@ -299,7 +299,7 @@ struct candidate_power_of_2_ct
, hdr_offset_size , hdr_offset_size
, overhead_percent> helper_t; , overhead_percent> helper_t;
static const std::size_t candidate_power_of_2 = initial_alignment << std::size_t(!helper_t::overhead_satisfied); BOOST_STATIC_CONSTEXPR std::size_t candidate_power_of_2 = initial_alignment << std::size_t(!helper_t::overhead_satisfied);
typedef typename candidate_power_of_2_ct typedef typename candidate_power_of_2_ct
< candidate_power_of_2 < candidate_power_of_2
@@ -312,9 +312,9 @@ struct candidate_power_of_2_ct
, !helper_t::overhead_satisfied , !helper_t::overhead_satisfied
>::type type; >::type type;
static const std::size_t alignment = type::alignment; BOOST_STATIC_CONSTEXPR std::size_t alignment = type::alignment;
static const std::size_t num_subblocks = type::num_subblocks; BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = type::num_subblocks;
static const std::size_t real_num_node = type::real_num_node; BOOST_STATIC_CONSTEXPR std::size_t real_num_node = type::real_num_node;
}; };
template< std::size_t initial_alignment template< std::size_t initial_alignment
@@ -354,9 +354,9 @@ struct candidate_power_of_2_ct
, hdr_offset_size , hdr_offset_size
, overhead_percent> helper_t; , overhead_percent> helper_t;
static const std::size_t alignment = initial_alignment; BOOST_STATIC_CONSTEXPR std::size_t alignment = initial_alignment;
static const std::size_t num_subblocks = helper_t::num_b_subblock+1; BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = helper_t::num_b_subblock+1;
static const std::size_t real_num_node = helper_t::total_nodes; BOOST_STATIC_CONSTEXPR std::size_t real_num_node = helper_t::total_nodes;
}; };
///////////////////////////////////////////// /////////////////////////////////////////////
@@ -429,13 +429,13 @@ class private_adaptive_node_pool_impl_common
typedef typename SegmentManagerBase::size_type size_type; typedef typename SegmentManagerBase::size_type size_type;
//Flags //Flags
//align_only //align_only
static const bool AlignOnly = (Flags & adaptive_pool_flag::align_only) != 0; BOOST_STATIC_CONSTEXPR bool AlignOnly = (Flags & adaptive_pool_flag::align_only) != 0;
typedef bool_<AlignOnly> IsAlignOnly; typedef bool_<AlignOnly> IsAlignOnly;
typedef true_ AlignOnlyTrue; typedef true_ AlignOnlyTrue;
typedef false_ AlignOnlyFalse; typedef false_ AlignOnlyFalse;
typedef typename SegmentManagerBase::void_pointer void_pointer; typedef typename SegmentManagerBase::void_pointer void_pointer;
static const typename SegmentManagerBase:: BOOST_STATIC_CONSTEXPR typename SegmentManagerBase::
size_type PayloadPerAllocation = SegmentManagerBase::PayloadPerAllocation; size_type PayloadPerAllocation = SegmentManagerBase::PayloadPerAllocation;
typedef typename boost::intrusive::pointer_traits typedef typename boost::intrusive::pointer_traits
@@ -453,9 +453,9 @@ class private_adaptive_node_pool_impl_common
typedef typename adaptive_pool_types_t::hdr_offset_holder hdr_offset_holder; typedef typename adaptive_pool_types_t::hdr_offset_holder hdr_offset_holder;
typedef private_adaptive_node_pool_impl_common this_type; typedef private_adaptive_node_pool_impl_common this_type;
static const size_type MaxAlign = alignment_of<void_pointer>::value; BOOST_STATIC_CONSTEXPR size_type MaxAlign = alignment_of<void_pointer>::value;
static const size_type HdrSize = ((sizeof(block_info_t)-1)/MaxAlign+1)*MaxAlign; BOOST_STATIC_CONSTEXPR size_type HdrSize = ((sizeof(block_info_t)-1)/MaxAlign+1)*MaxAlign;
static const size_type HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign; BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign;
segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager
block_container_t m_block_container; //Intrusive block list block_container_t m_block_container; //Intrusive block list
@@ -981,9 +981,9 @@ template< class SizeType
, bool AlignOnly> , bool AlignOnly>
struct calculate_alignment_ct struct calculate_alignment_ct
{ {
static const std::size_t alignment = upper_power_of_2_ct<SizeType, HdrSize + RealNodeSize*NodesPerBlock>::value; BOOST_STATIC_CONSTEXPR std::size_t alignment = upper_power_of_2_ct<SizeType, HdrSize + RealNodeSize*NodesPerBlock>::value;
static const std::size_t num_subblocks = 0; BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = 0;
static const std::size_t real_num_node = (alignment - PayloadPerAllocation - HdrSize)/RealNodeSize; BOOST_STATIC_CONSTEXPR std::size_t real_num_node = (alignment - PayloadPerAllocation - HdrSize)/RealNodeSize;
}; };
template< class SizeType template< class SizeType
@@ -1013,9 +1013,9 @@ struct calculate_alignment_ct
, OverheadPercent , OverheadPercent
>::type type; >::type type;
static const std::size_t alignment = type::alignment; BOOST_STATIC_CONSTEXPR std::size_t alignment = type::alignment;
static const std::size_t num_subblocks = type::num_subblocks; BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = type::num_subblocks;
static const std::size_t real_num_node = type::real_num_node; BOOST_STATIC_CONSTEXPR std::size_t real_num_node = type::real_num_node;
}; };
@@ -1046,17 +1046,17 @@ class private_adaptive_node_pool_impl_ct
typedef typename base_t::multiallocation_chain multiallocation_chain; typedef typename base_t::multiallocation_chain multiallocation_chain;
typedef typename base_t::segment_manager_base_type segment_manager_base_type; typedef typename base_t::segment_manager_base_type segment_manager_base_type;
static const typename base_t::size_type PayloadPerAllocation = base_t::PayloadPerAllocation; BOOST_STATIC_CONSTEXPR typename base_t::size_type PayloadPerAllocation = base_t::PayloadPerAllocation;
//align_only //align_only
static const bool AlignOnly = base_t::AlignOnly; BOOST_STATIC_CONSTEXPR bool AlignOnly = base_t::AlignOnly;
private: private:
static const size_type MaxAlign = base_t::MaxAlign; BOOST_STATIC_CONSTEXPR size_type MaxAlign = base_t::MaxAlign;
static const size_type HdrSize = base_t::HdrSize; BOOST_STATIC_CONSTEXPR size_type HdrSize = base_t::HdrSize;
static const size_type HdrOffsetSize = base_t::HdrOffsetSize; BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = base_t::HdrOffsetSize;
static const size_type RealNodeSize = lcm_ct<NodeSize, alignment_of<void_pointer>::value>::value; BOOST_STATIC_CONSTEXPR size_type RealNodeSize = lcm_ct<NodeSize, alignment_of<void_pointer>::value>::value;
typedef calculate_alignment_ct typedef calculate_alignment_ct
< size_type, HdrSize, PayloadPerAllocation < size_type, HdrSize, PayloadPerAllocation
@@ -1065,9 +1065,9 @@ class private_adaptive_node_pool_impl_ct
//Round the size to a power of two value. //Round the size to a power of two value.
//This is the total memory size (including payload) that we want to //This is the total memory size (including payload) that we want to
//allocate from the general-purpose allocator //allocate from the general-purpose allocator
static const size_type NumSubBlocks = data_t::num_subblocks; BOOST_STATIC_CONSTEXPR size_type NumSubBlocks = data_t::num_subblocks;
static const size_type RealNumNode = data_t::real_num_node; BOOST_STATIC_CONSTEXPR size_type RealNumNode = data_t::real_num_node;
static const size_type RealBlockAlignment = data_t::alignment; BOOST_STATIC_CONSTEXPR size_type RealBlockAlignment = data_t::alignment;
public: public:
@@ -1165,14 +1165,14 @@ class private_adaptive_node_pool_impl_rt
typedef typename impl_t::size_type size_type; typedef typename impl_t::size_type size_type;
typedef typename impl_t::multiallocation_chain multiallocation_chain; typedef typename impl_t::multiallocation_chain multiallocation_chain;
static const typename impl_t::size_type PayloadPerAllocation = impl_t::PayloadPerAllocation; BOOST_STATIC_CONSTEXPR typename impl_t::size_type PayloadPerAllocation = impl_t::PayloadPerAllocation;
//Flags //Flags
//align_only //align_only
static const bool AlignOnly = impl_t::AlignOnly; BOOST_STATIC_CONSTEXPR bool AlignOnly = impl_t::AlignOnly;
static const size_type HdrSize = impl_t::HdrSize; BOOST_STATIC_CONSTEXPR size_type HdrSize = impl_t::HdrSize;
static const size_type HdrOffsetSize = impl_t::HdrOffsetSize; BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = impl_t::HdrOffsetSize;
public: public:

View File

@@ -182,7 +182,7 @@ struct insert_copy_proxy
typedef boost::container::allocator_traits<Allocator> alloc_traits; typedef boost::container::allocator_traits<Allocator> alloc_traits;
typedef typename alloc_traits::value_type value_type; typedef typename alloc_traits::value_type value_type;
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_copy_proxy(const value_type &v) inline explicit insert_copy_proxy(const value_type &v)
: v_(v) : v_(v)
@@ -212,7 +212,7 @@ struct insert_move_proxy
typedef boost::container::allocator_traits<Allocator> alloc_traits; typedef boost::container::allocator_traits<Allocator> alloc_traits;
typedef typename alloc_traits::value_type value_type; typedef typename alloc_traits::value_type value_type;
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_move_proxy(value_type &v) inline explicit insert_move_proxy(value_type &v)
: v_(v) : v_(v)
@@ -265,7 +265,7 @@ struct insert_nonmovable_emplace_proxy
typedef typename alloc_traits::value_type value_type; typedef typename alloc_traits::value_type value_type;
typedef typename build_number_seq<sizeof...(Args)>::type index_tuple_t; typedef typename build_number_seq<sizeof...(Args)>::type index_tuple_t;
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_nonmovable_emplace_proxy(BOOST_FWD_REF(Args)... args) inline explicit insert_nonmovable_emplace_proxy(BOOST_FWD_REF(Args)... args)
: args_(args...) : args_(args...)
@@ -296,7 +296,7 @@ struct insert_emplace_proxy
typedef typename base_t::value_type value_type; typedef typename base_t::value_type value_type;
typedef typename base_t::index_tuple_t index_tuple_t; typedef typename base_t::index_tuple_t index_tuple_t;
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy(BOOST_FWD_REF(Args)... args) inline explicit insert_emplace_proxy(BOOST_FWD_REF(Args)... args)
: base_t(::boost::forward<Args>(args)...) : base_t(::boost::forward<Args>(args)...)
@@ -332,7 +332,7 @@ template<class Allocator>
struct insert_emplace_proxy<Allocator, typename boost::container::allocator_traits<Allocator>::value_type> struct insert_emplace_proxy<Allocator, typename boost::container::allocator_traits<Allocator>::value_type>
: public insert_move_proxy<Allocator> : public insert_move_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy(typename boost::container::allocator_traits<Allocator>::value_type &&v) inline explicit insert_emplace_proxy(typename boost::container::allocator_traits<Allocator>::value_type &&v)
: insert_move_proxy<Allocator>(v) : insert_move_proxy<Allocator>(v)
@@ -349,7 +349,7 @@ struct insert_emplace_proxy<Allocator
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)
@@ -360,7 +360,7 @@ template<class Allocator>
struct insert_emplace_proxy<Allocator, typename boost::container::allocator_traits<Allocator>::value_type &> struct insert_emplace_proxy<Allocator, typename boost::container::allocator_traits<Allocator>::value_type &>
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)
@@ -373,7 +373,7 @@ struct insert_emplace_proxy<Allocator
> >
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)
@@ -397,7 +397,7 @@ struct insert_nonmovable_emplace_proxy##N\
typedef boost::container::allocator_traits<Allocator> alloc_traits;\ typedef boost::container::allocator_traits<Allocator> alloc_traits;\
typedef typename alloc_traits::value_type value_type;\ typedef typename alloc_traits::value_type value_type;\
\ \
static const bool single_value = true;\ BOOST_STATIC_CONSTEXPR bool single_value = true;\
\ \
inline explicit insert_nonmovable_emplace_proxy##N(BOOST_MOVE_UREF##N)\ inline explicit insert_nonmovable_emplace_proxy##N(BOOST_MOVE_UREF##N)\
BOOST_MOVE_COLON##N BOOST_MOVE_FWD_INIT##N {}\ BOOST_MOVE_COLON##N BOOST_MOVE_FWD_INIT##N {}\
@@ -426,7 +426,7 @@ struct insert_emplace_proxy_arg##N\
typedef typename base_t::value_type value_type;\ typedef typename base_t::value_type value_type;\
typedef boost::container::allocator_traits<Allocator> alloc_traits;\ typedef boost::container::allocator_traits<Allocator> alloc_traits;\
\ \
static const bool single_value = true;\ BOOST_STATIC_CONSTEXPR bool single_value = true;\
\ \
inline explicit insert_emplace_proxy_arg##N(BOOST_MOVE_UREF##N)\ inline explicit insert_emplace_proxy_arg##N(BOOST_MOVE_UREF##N)\
: base_t(BOOST_MOVE_FWD##N){}\ : base_t(BOOST_MOVE_FWD##N){}\
@@ -460,7 +460,7 @@ template<class Allocator>
struct insert_emplace_proxy_arg1<Allocator, ::boost::rv<typename boost::container::allocator_traits<Allocator>::value_type> > struct insert_emplace_proxy_arg1<Allocator, ::boost::rv<typename boost::container::allocator_traits<Allocator>::value_type> >
: public insert_move_proxy<Allocator> : public insert_move_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_move_proxy<Allocator>(v) : insert_move_proxy<Allocator>(v)
@@ -471,7 +471,7 @@ template<class Allocator>
struct insert_emplace_proxy_arg1<Allocator, typename boost::container::allocator_traits<Allocator>::value_type> struct insert_emplace_proxy_arg1<Allocator, typename boost::container::allocator_traits<Allocator>::value_type>
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)
@@ -485,7 +485,7 @@ template<class Allocator>
struct insert_emplace_proxy_arg1<Allocator, typename boost::container::allocator_traits<Allocator>::value_type> struct insert_emplace_proxy_arg1<Allocator, typename boost::container::allocator_traits<Allocator>::value_type>
: public insert_move_proxy<Allocator> : public insert_move_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits<Allocator>::value_type &&v) inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits<Allocator>::value_type &&v)
: insert_move_proxy<Allocator>(v) : insert_move_proxy<Allocator>(v)
@@ -501,7 +501,7 @@ struct insert_emplace_proxy_arg1<Allocator
> >
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)
@@ -512,7 +512,7 @@ template<class Allocator>
struct insert_emplace_proxy_arg1<Allocator, typename boost::container::allocator_traits<Allocator>::value_type &> struct insert_emplace_proxy_arg1<Allocator, typename boost::container::allocator_traits<Allocator>::value_type &>
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)
@@ -525,7 +525,7 @@ struct insert_emplace_proxy_arg1<Allocator
> >
: public insert_copy_proxy<Allocator> : public insert_copy_proxy<Allocator>
{ {
static const bool single_value = true; BOOST_STATIC_CONSTEXPR bool single_value = true;
inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v) inline explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits<Allocator>::value_type &v)
: insert_copy_proxy<Allocator>(v) : insert_copy_proxy<Allocator>(v)

View File

@@ -42,13 +42,13 @@ enum allocation_type_v
typedef unsigned int allocation_type; typedef unsigned int allocation_type;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
static const allocation_type allocate_new = (allocation_type)allocate_new_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type allocate_new = (allocation_type)allocate_new_v;
static const allocation_type expand_fwd = (allocation_type)expand_fwd_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type expand_fwd = (allocation_type)expand_fwd_v;
static const allocation_type expand_bwd = (allocation_type)expand_bwd_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type expand_bwd = (allocation_type)expand_bwd_v;
static const allocation_type shrink_in_place = (allocation_type)shrink_in_place_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type shrink_in_place = (allocation_type)shrink_in_place_v;
static const allocation_type try_shrink_in_place= (allocation_type)try_shrink_in_place_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type try_shrink_in_place= (allocation_type)try_shrink_in_place_v;
static const allocation_type nothrow_allocation = (allocation_type)nothrow_allocation_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type nothrow_allocation = (allocation_type)nothrow_allocation_v;
static const allocation_type zero_memory = (allocation_type)zero_memory_v; BOOST_CONTAINER_CONSTANT_VAR allocation_type zero_memory = (allocation_type)zero_memory_v;
} //namespace container { } //namespace container {
} //namespace boost { } //namespace boost {

View File

@@ -74,11 +74,11 @@ class block_list_base
{ {
list_node m_list; list_node m_list;
static const std::size_t MaxAlignMinus1 = memory_resource::max_align-1u; BOOST_STATIC_CONSTEXPR std::size_t MaxAlignMinus1 = memory_resource::max_align-1u;
public: public:
static const std::size_t header_size = std::size_t(sizeof(DerivedFromBlockListHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1); BOOST_STATIC_CONSTEXPR std::size_t header_size = std::size_t(sizeof(DerivedFromBlockListHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1);
explicit block_list_base() explicit block_list_base()
{ list_algo::init_header(&m_list); } { list_algo::init_header(&m_list); }

View File

@@ -68,11 +68,11 @@ class block_slist_base
{ {
slist_node m_slist; slist_node m_slist;
static const std::size_t MaxAlignMinus1 = memory_resource::max_align-1u; BOOST_STATIC_CONSTEXPR std::size_t MaxAlignMinus1 = memory_resource::max_align-1u;
public: public:
static const std::size_t header_size = std::size_t(sizeof(DerivedFromBlockSlistHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1); BOOST_STATIC_CONSTEXPR std::size_t header_size = std::size_t(sizeof(DerivedFromBlockSlistHeader) + MaxAlignMinus1) & std::size_t(~MaxAlignMinus1);
explicit block_slist_base() explicit block_slist_base()
{ slist_algo::init_header(&m_slist); } { slist_algo::init_header(&m_slist); }

View File

@@ -64,7 +64,7 @@ namespace dtl {
template<class I> template<class I>
struct are_elements_contiguous struct are_elements_contiguous
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
///////////////////////// /////////////////////////
@@ -74,7 +74,7 @@ struct are_elements_contiguous
template<class T> template<class T>
struct are_elements_contiguous<T*> struct are_elements_contiguous<T*>
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
///////////////////////// /////////////////////////
@@ -115,7 +115,7 @@ namespace dtl {
template <class Pointer, bool IsConst> template <class Pointer, bool IsConst>
struct are_elements_contiguous<boost::container::vec_iterator<Pointer, IsConst> > struct are_elements_contiguous<boost::container::vec_iterator<Pointer, IsConst> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
@@ -126,7 +126,7 @@ struct are_elements_contiguous<boost::container::vec_iterator<Pointer, IsConst>
template <class PointedType, class DifferenceType, class OffsetType, std::size_t OffsetAlignment> template <class PointedType, class DifferenceType, class OffsetType, std::size_t OffsetAlignment>
struct are_elements_contiguous< ::boost::interprocess::offset_ptr<PointedType, DifferenceType, OffsetType, OffsetAlignment> > struct are_elements_contiguous< ::boost::interprocess::offset_ptr<PointedType, DifferenceType, OffsetType, OffsetAlignment> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template <typename I, typename O> template <typename I, typename O>
@@ -185,20 +185,20 @@ private:
template <class U> static two test(int, ...); template <class U> static two test(int, ...);
template <class U> static char test(int, const wrapper<U::single_value>*); template <class U> static char test(int, const wrapper<U::single_value>*);
public: public:
static const bool value = sizeof(test<T>(0, 0)) == 1; BOOST_STATIC_CONSTEXPR bool value = sizeof(test<T>(0, 0)) == 1;
void dummy() {} void dummy() {}
}; };
template<class InsertionProxy, bool = has_single_value<InsertionProxy>::value> template<class InsertionProxy, bool = has_single_value<InsertionProxy>::value>
struct is_single_value_proxy_impl struct is_single_value_proxy_impl
{ {
static const bool value = InsertionProxy::single_value; BOOST_STATIC_CONSTEXPR bool value = InsertionProxy::single_value;
}; };
template<class InsertionProxy> template<class InsertionProxy>
struct is_single_value_proxy_impl<InsertionProxy, false> struct is_single_value_proxy_impl<InsertionProxy, false>
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class InsertionProxy> template<class InsertionProxy>
@@ -293,7 +293,7 @@ template <typename O>
struct is_memzero_initializable struct is_memzero_initializable
{ {
typedef typename ::boost::container::iterator_traits<O>::value_type value_type; typedef typename ::boost::container::iterator_traits<O>::value_type value_type;
static const bool value = are_elements_contiguous<O>::value && BOOST_STATIC_CONSTEXPR bool value = are_elements_contiguous<O>::value &&
( dtl::is_integral<value_type>::value || dtl::is_enum<value_type>::value ( dtl::is_integral<value_type>::value || dtl::is_enum<value_type>::value
#if defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL) #if defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL)
|| dtl::is_pointer<value_type>::value || dtl::is_pointer<value_type>::value
@@ -1111,7 +1111,7 @@ inline typename dtl::disable_if_memtransfer_copy_assignable<F, G, void>::type
boost::container::destroy_alloc_n(a, large_range_f, std::size_t(n_j - n_i)); boost::container::destroy_alloc_n(a, large_range_f, std::size_t(n_j - n_i));
} }
static const std::size_t DeepSwapAllocNMaxStorage = std::size_t(1) << std::size_t(11); //2K bytes BOOST_CONTAINER_CONSTANT_VAR std::size_t DeepSwapAllocNMaxStorage = std::size_t(1) << std::size_t(11); //2K bytes
template template
<std::size_t MaxTmpBytes <std::size_t MaxTmpBytes
@@ -1496,8 +1496,8 @@ void expand_backward_forward_and_insert_alloc_move_backward
{ {
typedef std::size_t size_type; typedef std::size_t size_type;
typedef typename allocator_traits<Allocator>::value_type value_type; typedef typename allocator_traits<Allocator>::value_type value_type;
static const bool trivial_dctr_after_move = has_trivial_destructor_after_move<value_type>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = has_trivial_destructor_after_move<value_type>::value;
static const bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value;
typedef typename dtl::if_c typedef typename dtl::if_c
<trivial_dctr <trivial_dctr
@@ -1796,8 +1796,8 @@ inline void expand_backward_forward_and_insert_alloc_move_forward
{ {
typedef std::size_t size_type; typedef std::size_t size_type;
typedef typename allocator_traits<Allocator>::value_type value_type; typedef typename allocator_traits<Allocator>::value_type value_type;
static const bool trivial_dctr_after_move = has_trivial_destructor_after_move<value_type>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = has_trivial_destructor_after_move<value_type>::value;
static const bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible<value_type>::value;
typedef typename dtl::if_c typedef typename dtl::if_c
<trivial_dctr <trivial_dctr

View File

@@ -62,7 +62,7 @@ namespace dtl {
template<class X> template<class X>
static no_type test(...); static no_type test(...);
static const bool value = sizeof(test<T>(0)) == sizeof(yes_type); BOOST_STATIC_CONSTEXPR bool value = sizeof(test<T>(0)) == sizeof(yes_type);
}; };
template <class T, class InnerAlloc, class ...Args> template <class T, class InnerAlloc, class ...Args>

View File

@@ -583,7 +583,7 @@ class flat_tree
(boost::container::dtl::, container_type (boost::container::dtl::, container_type
,stored_allocator_type, allocator_type) stored_allocator_type; ,stored_allocator_type, allocator_type) stored_allocator_type;
static const bool has_stored_allocator_type = BOOST_STATIC_CONSTEXPR bool has_stored_allocator_type =
BOOST_INTRUSIVE_HAS_TYPE(boost::container::dtl::, container_type, stored_allocator_type); BOOST_INTRUSIVE_HAS_TYPE(boost::container::dtl::, container_type, stored_allocator_type);
private: private:
@@ -1700,7 +1700,7 @@ struct has_trivial_destructor_after_move<boost::container::dtl::flat_tree<T, Key
typedef boost::container::dtl::flat_tree<T, KeyOfValue, Compare, AllocatorOrContainer> flat_tree; typedef boost::container::dtl::flat_tree<T, KeyOfValue, Compare, AllocatorOrContainer> flat_tree;
typedef typename flat_tree::container_type container_type; typedef typename flat_tree::container_type container_type;
typedef typename flat_tree::key_compare key_compare; typedef typename flat_tree::key_compare key_compare;
static const bool value = ::boost::has_trivial_destructor_after_move<container_type>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<container_type>::value &&
::boost::has_trivial_destructor_after_move<key_compare>::value; ::boost::has_trivial_destructor_after_move<key_compare>::value;
}; };

View File

@@ -80,7 +80,7 @@ namespace function_detector {
template <class U> \ template <class U> \
static NotFoundType Test( ... ); \ static NotFoundType Test( ... ); \
public : \ public : \
static const int check = NotFound + (sizeof(Test<T>(0, 0)) - sizeof(NotFoundType));\ BOOST_STATIC_CONSTEXPR int check = NotFound + (sizeof(Test<T>(0, 0)) - sizeof(NotFoundType));\
};\ };\
}}} //namespace boost::container::function_detector { }}} //namespace boost::container::function_detector {

View File

@@ -51,7 +51,7 @@ namespace dtl {
template <class Container> template <class Container>
struct is_container struct is_container
{ {
static const bool value = BOOST_STATIC_CONSTEXPR bool value =
boost::container::is_container_detail:: boost::container::is_container_detail::
has_member_function_callable_with_size <const Container>::value && has_member_function_callable_with_size <const Container>::value &&
boost::container::is_container_detail:: boost::container::is_container_detail::
@@ -61,7 +61,7 @@ struct is_container
template <> template <>
struct is_container<void> struct is_container<void>
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };

View File

@@ -51,7 +51,7 @@ namespace dtl {
template <class Container> template <class Container>
struct is_contiguous_container struct is_contiguous_container
{ {
static const bool value = BOOST_STATIC_CONSTEXPR bool value =
boost::container::is_contiguous_container_detail:: boost::container::is_contiguous_container_detail::
has_member_function_callable_with_data<Container>::value && has_member_function_callable_with_data<Container>::value &&
boost::container::is_contiguous_container_detail:: boost::container::is_contiguous_container_detail::

View File

@@ -61,25 +61,25 @@ struct pair;
template <class T> template <class T>
struct is_pair struct is_pair
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template <class T1, class T2> template <class T1, class T2>
struct is_pair< pair<T1, T2> > struct is_pair< pair<T1, T2> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template <class T1, class T2> template <class T1, class T2>
struct is_pair< std::pair<T1, T2> > struct is_pair< std::pair<T1, T2> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template <class T> template <class T>
struct is_not_pair struct is_not_pair
{ {
static const bool value = !is_pair<T>::value; BOOST_STATIC_CONSTEXPR bool value = !is_pair<T>::value;
}; };
} //namespace dtl { } //namespace dtl {

View File

@@ -723,50 +723,50 @@ struct has_iterator_category
template <typename X> template <typename X>
static two test(int, ...); static two test(int, ...);
static const bool value = (1 == sizeof(test<T>(0, 0))); BOOST_STATIC_CONSTEXPR bool value = (1 == sizeof(test<T>(0, 0)));
}; };
template<class T, bool = has_iterator_category<T>::value > template<class T, bool = has_iterator_category<T>::value >
struct is_input_iterator struct is_input_iterator
{ {
static const bool value = is_same<typename T::iterator_category, std::input_iterator_tag>::value; BOOST_STATIC_CONSTEXPR bool value = is_same<typename T::iterator_category, std::input_iterator_tag>::value;
}; };
template<class T> template<class T>
struct is_input_iterator<T, false> struct is_input_iterator<T, false>
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class T> template<class T>
struct is_not_input_iterator struct is_not_input_iterator
{ {
static const bool value = !is_input_iterator<T>::value; BOOST_STATIC_CONSTEXPR bool value = !is_input_iterator<T>::value;
}; };
template<class T, bool = has_iterator_category<T>::value > template<class T, bool = has_iterator_category<T>::value >
struct is_forward_iterator struct is_forward_iterator
{ {
static const bool value = is_same<typename T::iterator_category, std::forward_iterator_tag>::value; BOOST_STATIC_CONSTEXPR bool value = is_same<typename T::iterator_category, std::forward_iterator_tag>::value;
}; };
template<class T> template<class T>
struct is_forward_iterator<T, false> struct is_forward_iterator<T, false>
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class T, bool = has_iterator_category<T>::value > template<class T, bool = has_iterator_category<T>::value >
struct is_bidirectional_iterator struct is_bidirectional_iterator
{ {
static const bool value = is_same<typename T::iterator_category, std::bidirectional_iterator_tag>::value; BOOST_STATIC_CONSTEXPR bool value = is_same<typename T::iterator_category, std::bidirectional_iterator_tag>::value;
}; };
template<class T> template<class T>
struct is_bidirectional_iterator<T, false> struct is_bidirectional_iterator<T, false>
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class IINodeType> template<class IINodeType>

View File

@@ -100,7 +100,7 @@ struct upper_power_of_2_loop_ct
template <Integer I, Integer P> template <Integer I, Integer P>
struct apply struct apply
{ {
static const Integer value = BOOST_STATIC_CONSTEXPR Integer value =
upper_power_of_2_loop_ct<Integer, (I > P*2)>::template apply<I, P*2>::value; upper_power_of_2_loop_ct<Integer, (I > P*2)>::template apply<I, P*2>::value;
}; };
}; };
@@ -111,14 +111,14 @@ struct upper_power_of_2_loop_ct<Integer, false>
template <Integer I, Integer P> template <Integer I, Integer P>
struct apply struct apply
{ {
static const Integer value = P; BOOST_STATIC_CONSTEXPR Integer value = P;
}; };
}; };
template <typename Integer, Integer I> template <typename Integer, Integer I>
struct upper_power_of_2_ct struct upper_power_of_2_ct
{ {
static const Integer value = upper_power_of_2_loop_ct<Integer, (I > 1)>::template apply<I, 2>::value; BOOST_STATIC_CONSTEXPR Integer value = upper_power_of_2_loop_ct<Integer, (I > 1)>::template apply<I, 2>::value;
}; };
//This function uses binary search to discover the //This function uses binary search to discover the
@@ -144,27 +144,27 @@ inline std::size_t floor_log2 (std::size_t x)
template<std::size_t I1, std::size_t I2> template<std::size_t I1, std::size_t I2>
struct gcd_ct struct gcd_ct
{ {
static const std::size_t Max = I1 > I2 ? I1 : I2; BOOST_STATIC_CONSTEXPR std::size_t Max = I1 > I2 ? I1 : I2;
static const std::size_t Min = I1 < I2 ? I1 : I2; BOOST_STATIC_CONSTEXPR std::size_t Min = I1 < I2 ? I1 : I2;
static const std::size_t value = gcd_ct<Min, Max % Min>::value; BOOST_STATIC_CONSTEXPR std::size_t value = gcd_ct<Min, Max % Min>::value;
}; };
template<std::size_t I1> template<std::size_t I1>
struct gcd_ct<I1, 0> struct gcd_ct<I1, 0>
{ {
static const std::size_t value = I1; BOOST_STATIC_CONSTEXPR std::size_t value = I1;
}; };
template<std::size_t I1> template<std::size_t I1>
struct gcd_ct<0, I1> struct gcd_ct<0, I1>
{ {
static const std::size_t value = I1; BOOST_STATIC_CONSTEXPR std::size_t value = I1;
}; };
template<std::size_t I1, std::size_t I2> template<std::size_t I1, std::size_t I2>
struct lcm_ct struct lcm_ct
{ {
static const std::size_t value = I1 * I2 / gcd_ct<I1, I2>::value; BOOST_STATIC_CONSTEXPR std::size_t value = I1 * I2 / gcd_ct<I1, I2>::value;
}; };
} // namespace dtl } // namespace dtl

View File

@@ -84,13 +84,13 @@ struct void_t { typedef void type; };
template <class T, class=void> template <class T, class=void>
struct is_transparent_base struct is_transparent_base
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template <class T> template <class T>
struct is_transparent_base<T, typename void_t<typename T::is_transparent>::type> struct is_transparent_base<T, typename void_t<typename T::is_transparent>::type>
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template <class T> template <class T>
@@ -112,7 +112,7 @@ template<typename...> using variadic_void_t = void;
template<typename Allocator, typename = void> template<typename Allocator, typename = void>
struct is_allocator struct is_allocator
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template <typename T> template <typename T>
@@ -123,7 +123,7 @@ struct is_allocator < Allocator,
variadic_void_t< typename Allocator::value_type variadic_void_t< typename Allocator::value_type
, decltype(ctad_declval<Allocator&>().allocate(size_t{})) >> , decltype(ctad_declval<Allocator&>().allocate(size_t{})) >>
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template<class T> template<class T>

View File

@@ -52,7 +52,7 @@ class private_node_pool
public: public:
typedef typename base_t::multiallocation_chain multiallocation_chain; typedef typename base_t::multiallocation_chain multiallocation_chain;
static const std::size_t nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock;
//!Constructor from a segment manager. Never throws //!Constructor from a segment manager. Never throws
private_node_pool() private_node_pool()

View File

@@ -46,7 +46,7 @@ namespace pair_impl {
template <class TupleClass> template <class TupleClass>
struct is_boost_tuple struct is_boost_tuple
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template < template <
@@ -56,7 +56,7 @@ template <
class T9> class T9>
struct is_boost_tuple< boost::tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> > struct is_boost_tuple< boost::tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template<class Tuple> template<class Tuple>
@@ -67,13 +67,13 @@ struct disable_if_boost_tuple
template<class T> template<class T>
struct is_tuple_null struct is_tuple_null
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<> template<>
struct is_tuple_null<boost::tuples::null_type> struct is_tuple_null<boost::tuples::null_type>
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
} //namespace detail { } //namespace detail {
@@ -482,7 +482,7 @@ inline void swap(pair<T1, T2>& x, pair<T1, T2>& y)
template<class T1, class T2> template<class T1, class T2>
struct has_move_emulation_enabled< ::boost::container::dtl::pair<T1, T2> > struct has_move_emulation_enabled< ::boost::container::dtl::pair<T1, T2> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
#endif #endif
@@ -497,7 +497,7 @@ struct is_class_or_union< ::boost::container::dtl::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in //This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps. //is_class, and allow recursive maps.
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template <class T1, class T2> template <class T1, class T2>
@@ -505,7 +505,7 @@ struct is_class_or_union< std::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in //This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps. //is_class, and allow recursive maps.
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template<class T> template<class T>
@@ -516,7 +516,7 @@ struct is_union< ::boost::container::dtl::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in //This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps. //is_class, and allow recursive maps.
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template <class T1, class T2> template <class T1, class T2>
@@ -524,7 +524,7 @@ struct is_union< std::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in //This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps. //is_class, and allow recursive maps.
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class T> template<class T>
@@ -535,7 +535,7 @@ struct is_class< ::boost::container::dtl::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in //This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps. //is_class, and allow recursive maps.
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
template <class T1, class T2> template <class T1, class T2>
@@ -543,7 +543,7 @@ struct is_class< std::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in //This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps. //is_class, and allow recursive maps.
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
@@ -555,7 +555,7 @@ template<class A, class B>
struct is_trivially_copy_assignable struct is_trivially_copy_assignable
<boost::container::dtl::pair<A,B> > <boost::container::dtl::pair<A,B> >
{ {
static const bool value = false ; BOOST_STATIC_CONSTEXPR bool value = false ;
}; };
template<class T> template<class T>
@@ -565,7 +565,7 @@ template<class A, class B>
struct is_trivially_move_assignable struct is_trivially_move_assignable
<boost::container::dtl::pair<A,B> > <boost::container::dtl::pair<A,B> >
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class T> template<class T>
@@ -574,7 +574,7 @@ struct is_trivially_copy_assignable;
template<class A, class B> template<class A, class B>
struct is_trivially_copy_constructible<boost::container::dtl::pair<A,B> > struct is_trivially_copy_constructible<boost::container::dtl::pair<A,B> >
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class T> template<class T>
@@ -583,7 +583,7 @@ struct is_trivially_move_assignable;
template<class A, class B> template<class A, class B>
struct is_trivially_move_constructible<boost::container::dtl::pair<A,B> > struct is_trivially_move_constructible<boost::container::dtl::pair<A,B> >
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class T> template<class T>
@@ -592,7 +592,7 @@ struct is_trivially_destructible;
template<class A, class B> template<class A, class B>
struct is_trivially_destructible<boost::container::dtl::pair<A,B> > struct is_trivially_destructible<boost::container::dtl::pair<A,B> >
{ {
static const bool value = boost::move_detail::is_trivially_destructible<A>::value && BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_destructible<A>::value &&
boost::move_detail::is_trivially_destructible<B>::value ; boost::move_detail::is_trivially_destructible<B>::value ;
}; };

View File

@@ -45,7 +45,7 @@ struct node_slist
template<class T> template<class T>
struct is_stateless_segment_manager struct is_stateless_segment_manager
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
} //namespace dtl { } //namespace dtl {

View File

@@ -39,7 +39,7 @@ struct node_slist_helper
struct fake_segment_manager struct fake_segment_manager
{ {
typedef void * void_pointer; typedef void * void_pointer;
static const std::size_t PayloadPerAllocation = BOOST_CONTAINER_ALLOCATION_PAYLOAD; BOOST_STATIC_CONSTEXPR std::size_t PayloadPerAllocation = BOOST_CONTAINER_ALLOCATION_PAYLOAD;
typedef boost::container::dtl:: typedef boost::container::dtl::
basic_multiallocation_chain<void*> multiallocation_chain; basic_multiallocation_chain<void*> multiallocation_chain;
@@ -90,7 +90,7 @@ template<>
struct is_stateless_segment_manager struct is_stateless_segment_manager
<boost::container::dtl::fake_segment_manager> <boost::container::dtl::fake_segment_manager>
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
} //namespace dtl { } //namespace dtl {

View File

@@ -31,11 +31,11 @@ namespace pmr {
class pool_data_t; class pool_data_t;
static const std::size_t pool_options_minimum_max_blocks_per_chunk = 1u; BOOST_CONTAINER_CONSTANT_VAR std::size_t pool_options_minimum_max_blocks_per_chunk = 1u;
static const std::size_t pool_options_default_max_blocks_per_chunk = 32u; BOOST_CONTAINER_CONSTANT_VAR std::size_t pool_options_default_max_blocks_per_chunk = 32u;
static const std::size_t pool_options_minimum_largest_required_pool_block = BOOST_CONTAINER_CONSTANT_VAR std::size_t pool_options_minimum_largest_required_pool_block =
memory_resource::max_align > 2*sizeof(void*) ? memory_resource::max_align : 2*sizeof(void*); memory_resource::max_align > 2*sizeof(void*) ? memory_resource::max_align : 2*sizeof(void*);
static const std::size_t pool_options_default_largest_required_pool_block = BOOST_CONTAINER_CONSTANT_VAR std::size_t pool_options_default_largest_required_pool_block =
pool_options_minimum_largest_required_pool_block > 4096u pool_options_minimum_largest_required_pool_block > 4096u
? pool_options_minimum_largest_required_pool_block : 4096u; ? pool_options_minimum_largest_required_pool_block : 4096u;

View File

@@ -251,13 +251,13 @@ struct intrusive_tree_type
//Trait to detect manually rebalanceable tree types //Trait to detect manually rebalanceable tree types
template<boost::container::tree_type_enum tree_type_value> template<boost::container::tree_type_enum tree_type_value>
struct is_manually_balanceable struct is_manually_balanceable
{ static const bool value = true; }; { BOOST_STATIC_CONSTEXPR bool value = true; };
template<> struct is_manually_balanceable<red_black_tree> template<> struct is_manually_balanceable<red_black_tree>
{ static const bool value = false; }; { BOOST_STATIC_CONSTEXPR bool value = false; };
template<> struct is_manually_balanceable<avl_tree> template<> struct is_manually_balanceable<avl_tree>
{ static const bool value = false; }; { BOOST_STATIC_CONSTEXPR bool value = false; };
//Proxy traits to implement different operations depending on the //Proxy traits to implement different operations depending on the
//is_manually_balanceable<>::value //is_manually_balanceable<>::value
@@ -1240,13 +1240,13 @@ class tree
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, iterator>::type typename dtl::enable_if_transparent<key_compare, K, iterator>::type
find(const K& k) find(const K& k)
{ return iterator(this->icont().find(k, KeyNodeCompare())); } { return iterator(this->icont().find(k, KeyNodeCompare(key_comp()))); }
template <class K> template <class K>
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, const_iterator>::type typename dtl::enable_if_transparent<key_compare, K, const_iterator>::type
find(const K& k) const find(const K& k) const
{ return const_iterator(this->non_const_icont().find(k, KeyNodeCompare())); } { return const_iterator(this->non_const_icont().find(k, KeyNodeCompare(key_comp()))); }
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
size_type count(const key_type& k) const size_type count(const key_type& k) const
@@ -1256,7 +1256,7 @@ class tree
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, size_type>::type typename dtl::enable_if_transparent<key_compare, K, size_type>::type
count(const K& k) const count(const K& k) const
{ return size_type(this->icont().count(k, KeyNodeCompare())); } { return size_type(this->icont().count(k, KeyNodeCompare(key_comp()))); }
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
bool contains(const key_type& x) const bool contains(const key_type& x) const
@@ -1280,13 +1280,13 @@ class tree
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, iterator>::type typename dtl::enable_if_transparent<key_compare, K, iterator>::type
lower_bound(const K& k) lower_bound(const K& k)
{ return iterator(this->icont().lower_bound(k, KeyNodeCompare())); } { return iterator(this->icont().lower_bound(k, KeyNodeCompare(key_comp()))); }
template <class K> template <class K>
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, const_iterator>::type typename dtl::enable_if_transparent<key_compare, K, const_iterator>::type
lower_bound(const K& k) const lower_bound(const K& k) const
{ return const_iterator(this->non_const_icont().lower_bound(k, KeyNodeCompare())); } { return const_iterator(this->non_const_icont().lower_bound(k, KeyNodeCompare(key_comp()))); }
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
iterator upper_bound(const key_type& k) iterator upper_bound(const key_type& k)
@@ -1300,13 +1300,13 @@ class tree
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, iterator>::type typename dtl::enable_if_transparent<key_compare, K, iterator>::type
upper_bound(const K& k) upper_bound(const K& k)
{ return iterator(this->icont().upper_bound(k, KeyNodeCompare())); } { return iterator(this->icont().upper_bound(k, KeyNodeCompare(key_comp()))); }
template <class K> template <class K>
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
typename dtl::enable_if_transparent<key_compare, K, const_iterator>::type typename dtl::enable_if_transparent<key_compare, K, const_iterator>::type
upper_bound(const K& k) const upper_bound(const K& k) const
{ return const_iterator(this->non_const_icont().upper_bound(k, KeyNodeCompare())); } { return const_iterator(this->non_const_icont().upper_bound(k, KeyNodeCompare(key_comp()))); }
BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline BOOST_CONTAINER_ATTRIBUTE_NODISCARD inline
std::pair<iterator,iterator> equal_range(const key_type& k) std::pair<iterator,iterator> equal_range(const key_type& k)
@@ -1330,7 +1330,7 @@ class tree
equal_range(const K& k) equal_range(const K& k)
{ {
std::pair<iiterator, iiterator> ret = std::pair<iiterator, iiterator> ret =
this->icont().equal_range(k, KeyNodeCompare()); this->icont().equal_range(k, KeyNodeCompare(key_comp()));
return std::pair<iterator,iterator>(iterator(ret.first), iterator(ret.second)); return std::pair<iterator,iterator>(iterator(ret.first), iterator(ret.second));
} }
@@ -1340,7 +1340,7 @@ class tree
equal_range(const K& k) const equal_range(const K& k) const
{ {
std::pair<iiterator, iiterator> ret = std::pair<iiterator, iiterator> ret =
this->non_const_icont().equal_range(k, KeyNodeCompare()); this->non_const_icont().equal_range(k, KeyNodeCompare(key_comp()));
return std::pair<const_iterator,const_iterator> return std::pair<const_iterator,const_iterator>
(const_iterator(ret.first), const_iterator(ret.second)); (const_iterator(ret.first), const_iterator(ret.second));
} }
@@ -1368,7 +1368,7 @@ class tree
lower_bound_range(const K& k) lower_bound_range(const K& k)
{ {
std::pair<iiterator, iiterator> ret = std::pair<iiterator, iiterator> ret =
this->icont().lower_bound_range(k, KeyNodeCompare()); this->icont().lower_bound_range(k, KeyNodeCompare(key_comp()));
return std::pair<iterator,iterator>(iterator(ret.first), iterator(ret.second)); return std::pair<iterator,iterator>(iterator(ret.first), iterator(ret.second));
} }
@@ -1378,7 +1378,7 @@ class tree
lower_bound_range(const K& k) const lower_bound_range(const K& k) const
{ {
std::pair<iiterator, iiterator> ret = std::pair<iiterator, iiterator> ret =
this->non_const_icont().lower_bound_range(k, KeyNodeCompare()); this->non_const_icont().lower_bound_range(k, KeyNodeCompare(key_comp()));
return std::pair<const_iterator,const_iterator> return std::pair<const_iterator,const_iterator>
(const_iterator(ret.first), const_iterator(ret.second)); (const_iterator(ret.first), const_iterator(ret.second));
} }
@@ -1433,9 +1433,10 @@ struct has_trivial_destructor_after_move
{ {
typedef typename ::boost::container::dtl::tree<T, KeyOfValue, Compare, Allocator, Options>::allocator_type allocator_type; typedef typename ::boost::container::dtl::tree<T, KeyOfValue, Compare, Allocator, Options>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value =
::boost::has_trivial_destructor_after_move<pointer>::value && ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<Compare>::value; ::boost::has_trivial_destructor_after_move<pointer>::value &&
::boost::has_trivial_destructor_after_move<Compare>::value;
}; };
} //namespace boost { } //namespace boost {

View File

@@ -57,20 +57,20 @@ struct has_version
template <class U> static two test(...); template <class U> static two test(...);
template <class U> static char test(const typename U::version*); template <class U> static char test(const typename U::version*);
public: public:
static const bool value = sizeof(test<T>(0)) == 1; BOOST_STATIC_CONSTEXPR bool value = sizeof(test<T>(0)) == 1;
void dummy(){} void dummy(){}
}; };
template <class T, bool = has_version<T>::value> template <class T, bool = has_version<T>::value>
struct version struct version
{ {
static const unsigned value = 1; BOOST_STATIC_CONSTEXPR unsigned value = 1;
}; };
template <class T> template <class T>
struct version<T, true> struct version<T, true>
{ {
static const unsigned value = extract_version<T>::type::value; BOOST_STATIC_CONSTEXPR unsigned value = extract_version<T>::type::value;
}; };
} //namespace impl } //namespace impl
@@ -83,7 +83,7 @@ struct version
template<class T, unsigned N> template<class T, unsigned N>
struct is_version struct is_version
{ {
static const bool value = BOOST_STATIC_CONSTEXPR bool value =
is_same< typename version<T>::type, integral_constant<unsigned, N> >::value; is_same< typename version<T>::type, integral_constant<unsigned, N> >::value;
}; };

View File

@@ -230,4 +230,10 @@ namespace boost {
# define BOOST_CONTAINER_STATIC_ASSERT_MSG( B, Msg ) BOOST_CONTAINER_STATIC_ASSERT( B ) # define BOOST_CONTAINER_STATIC_ASSERT_MSG( B, Msg ) BOOST_CONTAINER_STATIC_ASSERT( B )
#endif #endif
#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
# define BOOST_CONTAINER_CONSTANT_VAR BOOST_INLINE_CONSTEXPR
#else
# define BOOST_CONTAINER_CONSTANT_VAR static BOOST_CONSTEXPR_OR_CONST
#endif
#endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP

View File

@@ -147,7 +147,7 @@ class devector
typedef typename get_devector_opt<Options, alloc_size_type>::type options_type; typedef typename get_devector_opt<Options, alloc_size_type>::type options_type;
typedef typename options_type::growth_factor_type growth_factor_type; typedef typename options_type::growth_factor_type growth_factor_type;
typedef typename options_type::stored_size_type stored_size_type; typedef typename options_type::stored_size_type stored_size_type;
static const std::size_t devector_min_free_fraction = BOOST_STATIC_CONSTEXPR std::size_t devector_min_free_fraction =
options_type::free_fraction; options_type::free_fraction;
#endif // ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #endif // ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -3030,8 +3030,9 @@ struct has_trivial_destructor_after_move<boost::container::devector<T, Allocator
{ {
typedef typename boost::container::devector<T, Allocator, Options>::allocator_type allocator_type; typedef typename boost::container::devector<T, Allocator, Options>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value =
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value;
}; };
} }

View File

@@ -1768,7 +1768,7 @@ struct has_trivial_destructor_after_move<boost::container::flat_map<Key, T, Comp
typedef ::boost::container::dtl::pair<Key, T> value_t; typedef ::boost::container::dtl::pair<Key, T> value_t;
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree; typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {
@@ -3102,7 +3102,7 @@ struct has_trivial_destructor_after_move< boost::container::flat_multimap<Key, T
typedef ::boost::container::dtl::pair<Key, T> value_t; typedef ::boost::container::dtl::pair<Key, T> value_t;
typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind<AllocatorOrContainer, value_t>::type alloc_or_cont_t;
typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree; typedef ::boost::container::dtl::flat_tree<value_t,::boost::container::dtl::select1st<Key>, Compare, alloc_or_cont_t> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
} //namespace boost { } //namespace boost {

View File

@@ -1201,7 +1201,7 @@ template <class Key, class Compare, class AllocatorOrContainer>
struct has_trivial_destructor_after_move<boost::container::flat_set<Key, Compare, AllocatorOrContainer> > struct has_trivial_destructor_after_move<boost::container::flat_set<Key, Compare, AllocatorOrContainer> >
{ {
typedef ::boost::container::dtl::flat_tree<Key, ::boost::container::dtl::identity<Key>, Compare, AllocatorOrContainer> tree; typedef ::boost::container::dtl::flat_tree<Key, ::boost::container::dtl::identity<Key>, Compare, AllocatorOrContainer> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {
@@ -1932,7 +1932,7 @@ template <class Key, class Compare, class AllocatorOrContainer>
struct has_trivial_destructor_after_move<boost::container::flat_multiset<Key, Compare, AllocatorOrContainer> > struct has_trivial_destructor_after_move<boost::container::flat_multiset<Key, Compare, AllocatorOrContainer> >
{ {
typedef ::boost::container::dtl::flat_tree<Key, ::boost::container::dtl::identity<Key>, Compare, AllocatorOrContainer> tree; typedef ::boost::container::dtl::flat_tree<Key, ::boost::container::dtl::identity<Key>, Compare, AllocatorOrContainer> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {

View File

@@ -1504,7 +1504,7 @@ struct has_trivial_destructor_after_move<boost::container::list<T, Allocator> >
{ {
typedef typename boost::container::list<T, Allocator>::allocator_type allocator_type; typedef typename boost::container::list<T, Allocator>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<pointer>::value;
}; };

View File

@@ -1376,7 +1376,7 @@ template <class Key, class T, class Compare, class Allocator, class Options>
struct has_trivial_destructor_after_move<boost::container::map<Key, T, Compare, Allocator, Options> > struct has_trivial_destructor_after_move<boost::container::map<Key, T, Compare, Allocator, Options> >
{ {
typedef ::boost::container::dtl::tree<std::pair<const Key, T>, int, Compare, Allocator, Options> tree; typedef ::boost::container::dtl::tree<std::pair<const Key, T>, int, Compare, Allocator, Options> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {
@@ -2298,7 +2298,7 @@ template <class Key, class T, class Compare, class Allocator, class Options>
struct has_trivial_destructor_after_move<boost::container::multimap<Key, T, Compare, Allocator, Options> > struct has_trivial_destructor_after_move<boost::container::multimap<Key, T, Compare, Allocator, Options> >
{ {
typedef ::boost::container::dtl::tree<std::pair<const Key, T>, int, Compare, Allocator, Options> tree; typedef ::boost::container::dtl::tree<std::pair<const Key, T>, int, Compare, Allocator, Options> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {

View File

@@ -33,7 +33,7 @@ namespace container {
template<bool Value> template<bool Value>
struct new_allocator_bool struct new_allocator_bool
{ static const bool value = Value; }; { BOOST_STATIC_CONSTEXPR bool value = Value; };
template<class T> template<class T>
class new_allocator; class new_allocator;

View File

@@ -63,7 +63,7 @@ class node_allocator
typedef unsigned int allocation_type; typedef unsigned int allocation_type;
typedef node_allocator<T, NodesPerBlock, Version> self_t; typedef node_allocator<T, NodesPerBlock, Version> self_t;
static const std::size_t nodes_per_block = NodesPerBlock; BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock;
BOOST_CONTAINER_STATIC_ASSERT((Version <=2)); BOOST_CONTAINER_STATIC_ASSERT((Version <=2));
#endif #endif

View File

@@ -52,8 +52,8 @@ enum tree_type_enum
template<tree_type_enum TreeType, bool OptimizeSize> template<tree_type_enum TreeType, bool OptimizeSize>
struct tree_opt struct tree_opt
{ {
static const boost::container::tree_type_enum tree_type = TreeType; BOOST_STATIC_CONSTEXPR boost::container::tree_type_enum tree_type = TreeType;
static const bool optimize_size = OptimizeSize; BOOST_STATIC_CONSTEXPR bool optimize_size = OptimizeSize;
}; };
typedef tree_opt<red_black_tree, true> tree_assoc_defaults; typedef tree_opt<red_black_tree, true> tree_assoc_defaults;
@@ -116,10 +116,10 @@ using tree_assoc_options_t = typename boost::container::tree_assoc_options<Optio
template<bool StoreHash, bool CacheBegin, bool LinearBuckets, bool FastmodBuckets> template<bool StoreHash, bool CacheBegin, bool LinearBuckets, bool FastmodBuckets>
struct hash_opt struct hash_opt
{ {
static const bool store_hash = StoreHash; BOOST_STATIC_CONSTEXPR bool store_hash = StoreHash;
static const bool cache_begin = CacheBegin; BOOST_STATIC_CONSTEXPR bool cache_begin = CacheBegin;
static const bool linear_buckets = LinearBuckets; BOOST_STATIC_CONSTEXPR bool linear_buckets = LinearBuckets;
static const bool fastmod_buckets = FastmodBuckets; BOOST_STATIC_CONSTEXPR bool fastmod_buckets = FastmodBuckets;
}; };
typedef hash_opt<false, false, false, false> hash_assoc_defaults; typedef hash_opt<false, false, false, false> hash_assoc_defaults;
@@ -203,13 +203,13 @@ struct default_if_void<void, Default>
template<std::size_t N, std::size_t DefaultN> template<std::size_t N, std::size_t DefaultN>
struct default_if_zero struct default_if_zero
{ {
static const std::size_t value = N; BOOST_STATIC_CONSTEXPR std::size_t value = N;
}; };
template<std::size_t DefaultN> template<std::size_t DefaultN>
struct default_if_zero<0u, DefaultN> struct default_if_zero<0u, DefaultN>
{ {
static const std::size_t value = DefaultN; BOOST_STATIC_CONSTEXPR std::size_t value = DefaultN;
}; };
@@ -364,7 +364,7 @@ template<class GrowthType, std::size_t InplaceAlignment>
struct small_vector_opt struct small_vector_opt
{ {
typedef GrowthType growth_factor_type; typedef GrowthType growth_factor_type;
static const std::size_t inplace_alignment = InplaceAlignment; BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment;
}; };
typedef small_vector_opt<void, 0u> small_vector_null_opt; typedef small_vector_opt<void, 0u> small_vector_null_opt;
@@ -430,8 +430,8 @@ BOOST_INTRUSIVE_OPTION_CONSTANT(throw_on_overflow, bool, ThrowOnOverflow, throw_
template<bool ThrowOnOverflow, std::size_t InplaceAlignment> template<bool ThrowOnOverflow, std::size_t InplaceAlignment>
struct static_vector_opt struct static_vector_opt
{ {
static const bool throw_on_overflow = ThrowOnOverflow; BOOST_STATIC_CONSTEXPR bool throw_on_overflow = ThrowOnOverflow;
static const std::size_t inplace_alignment = InplaceAlignment; BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment;
}; };
typedef static_vector_opt<true, 0u> static_vector_null_opt; typedef static_vector_opt<true, 0u> static_vector_null_opt;
@@ -515,7 +515,7 @@ template<class GrowthType, class StoredSizeType, std::size_t FreeFraction>
struct devector_opt struct devector_opt
: vector_opt<GrowthType, StoredSizeType> : vector_opt<GrowthType, StoredSizeType>
{ {
static const std::size_t free_fraction = FreeFraction; BOOST_STATIC_CONSTEXPR std::size_t free_fraction = FreeFraction;
}; };
typedef devector_opt<void, void, 0u> devector_null_opt; typedef devector_opt<void, void, 0u> devector_null_opt;
@@ -606,8 +606,8 @@ using devector_options_t = typename boost::container::devector_options<Options..
template<std::size_t BlockBytes, std::size_t BlockSize> template<std::size_t BlockBytes, std::size_t BlockSize>
struct deque_opt struct deque_opt
{ {
static const std::size_t block_bytes = BlockBytes; BOOST_STATIC_CONSTEXPR std::size_t block_bytes = BlockBytes;
static const std::size_t block_size = BlockSize; BOOST_STATIC_CONSTEXPR std::size_t block_size = BlockSize;
BOOST_CONTAINER_STATIC_ASSERT_MSG(!(block_bytes && block_size), "block_bytes and block_size can't be specified at the same time"); BOOST_CONTAINER_STATIC_ASSERT_MSG(!(block_bytes && block_size), "block_bytes and block_size can't be specified at the same time");
}; };

View File

@@ -32,7 +32,7 @@ class memory_resource
{ {
public: public:
// For exposition only // For exposition only
static BOOST_CONSTEXPR_OR_CONST std::size_t max_align = BOOST_STATIC_CONSTEXPR std::size_t max_align =
boost::move_detail::alignment_of<boost::move_detail::max_align_t>::value; boost::move_detail::alignment_of<boost::move_detail::max_align_t>::value;
//! <b>Effects</b>: Destroys //! <b>Effects</b>: Destroys

View File

@@ -70,7 +70,7 @@ class BOOST_CONTAINER_DECL monotonic_buffer_resource
//! to the upstream allocator //! to the upstream allocator
//! //!
//! <b>Note</b>: Non-standard extension. //! <b>Note</b>: Non-standard extension.
static const std::size_t initial_next_buffer_size = 32u*sizeof(void*); BOOST_STATIC_CONSTEXPR std::size_t initial_next_buffer_size = 32u*sizeof(void*);
//! <b>Requires</b>: `upstream` shall be the address of a valid memory resource or `nullptr` //! <b>Requires</b>: `upstream` shall be the address of a valid memory resource or `nullptr`
//! //!

View File

@@ -36,19 +36,19 @@ namespace pmr_dtl {
template<class T> template<class T>
struct max_allocator_alignment struct max_allocator_alignment
{ {
static const std::size_t value = 1; BOOST_STATIC_CONSTEXPR std::size_t value = 1;
}; };
template<class T> template<class T>
struct max_allocator_alignment< ::boost::container::new_allocator<T> > struct max_allocator_alignment< ::boost::container::new_allocator<T> >
{ {
static const std::size_t value = boost::move_detail::alignment_of<boost::move_detail::max_align_t>::value; BOOST_STATIC_CONSTEXPR std::size_t value = boost::move_detail::alignment_of<boost::move_detail::max_align_t>::value;
}; };
template<class T> template<class T>
struct max_allocator_alignment< std::allocator<T> > struct max_allocator_alignment< std::allocator<T> >
{ {
static const std::size_t value = boost::move_detail::alignment_of<boost::move_detail::max_align_t>::value; BOOST_STATIC_CONSTEXPR std::size_t value = boost::move_detail::alignment_of<boost::move_detail::max_align_t>::value;
}; };
} //namespace pmr_dtl } //namespace pmr_dtl

View File

@@ -56,7 +56,7 @@ struct is_scoped_allocator_imp
template <typename T> template <typename T>
static int test(...); static int test(...);
static const bool value = (sizeof(yes_type) == sizeof(test<Allocator>(0))); BOOST_STATIC_CONSTEXPR bool value = (sizeof(yes_type) == sizeof(test<Allocator>(0)));
}; };
template<class MaybeScopedAlloc, bool = is_scoped_allocator_imp<MaybeScopedAlloc>::value > template<class MaybeScopedAlloc, bool = is_scoped_allocator_imp<MaybeScopedAlloc>::value >

View File

@@ -1026,7 +1026,7 @@ template <class Key, class Compare, class Allocator, class Options>
struct has_trivial_destructor_after_move<boost::container::set<Key, Compare, Allocator, Options> > struct has_trivial_destructor_after_move<boost::container::set<Key, Compare, Allocator, Options> >
{ {
typedef ::boost::container::dtl::tree<Key, void, Compare, Allocator, Options> tree; typedef ::boost::container::dtl::tree<Key, void, Compare, Allocator, Options> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {
@@ -1681,7 +1681,7 @@ template <class Key, class Compare, class Allocator, class Options>
struct has_trivial_destructor_after_move<boost::container::multiset<Key, Compare, Allocator, Options> > struct has_trivial_destructor_after_move<boost::container::multiset<Key, Compare, Allocator, Options> >
{ {
typedef ::boost::container::dtl::tree<Key, void, Compare, Allocator, Options> tree; typedef ::boost::container::dtl::tree<Key, void, Compare, Allocator, Options> tree;
static const bool value = ::boost::has_trivial_destructor_after_move<tree>::value; BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<tree>::value;
}; };
namespace container { namespace container {

View File

@@ -1673,7 +1673,7 @@ struct has_trivial_destructor_after_move<boost::container::slist<T, Allocator> >
{ {
typedef typename boost::container::slist<T, Allocator>::allocator_type allocator_type; typedef typename boost::container::slist<T, Allocator>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<pointer>::value;
}; };

View File

@@ -304,13 +304,13 @@ struct small_vector_storage
typedef typename dtl::aligned_storage typedef typename dtl::aligned_storage
<sizeof(T)*N, Alignment>::type storage_type; <sizeof(T)*N, Alignment>::type storage_type;
storage_type m_storage; storage_type m_storage;
static const std::size_t sms_size = sizeof(storage_type)/sizeof(T); BOOST_STATIC_CONSTEXPR std::size_t sms_size = sizeof(storage_type)/sizeof(T);
}; };
template<class T, std::size_t Alignment> template<class T, std::size_t Alignment>
struct small_vector_storage<T, 0u, Alignment> struct small_vector_storage<T, 0u, Alignment>
{ {
static const std::size_t sms_size = 0u; BOOST_STATIC_CONSTEXPR std::size_t sms_size = 0u;
}; };
//! This class consists of common code from all small_vector<T, N> types that don't depend on the //! This class consists of common code from all small_vector<T, N> types that don't depend on the
@@ -448,7 +448,7 @@ template<class T, std::size_t N, class Options>
struct small_vector_storage_definer struct small_vector_storage_definer
{ {
typedef typename dtl::get_small_vector_opt<Options>::type options_t; typedef typename dtl::get_small_vector_opt<Options>::type options_t;
static const std::size_t final_alignment = BOOST_STATIC_CONSTEXPR std::size_t final_alignment =
options_t::inplace_alignment ? options_t::inplace_alignment : dtl::alignment_of<T>::value; options_t::inplace_alignment ? options_t::inplace_alignment : dtl::alignment_of<T>::value;
typedef small_vector_storage<T, N, final_alignment> type; typedef small_vector_storage<T, N, final_alignment> type;
}; };
@@ -557,7 +557,7 @@ class small_vector
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
//! @brief The capacity/max size of the container //! @brief The capacity/max size of the container
static const size_type static_capacity = small_vector_storage_definer<T, N, Options>::type::sms_size; BOOST_STATIC_CONSTEXPR size_type static_capacity = small_vector_storage_definer<T, N, Options>::type::sms_size;
public: public:
inline small_vector() inline small_vector()
@@ -680,7 +680,7 @@ template <class T, class Allocator>
struct has_trivial_destructor_after_move<boost::container::vector<T, Allocator> > struct has_trivial_destructor_after_move<boost::container::vector<T, Allocator> >
{ {
typedef typename ::boost::container::allocator_traits<Allocator>::pointer pointer; typedef typename ::boost::container::allocator_traits<Allocator>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<Allocator>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<Allocator>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<pointer>::value;
}; };

View File

@@ -214,7 +214,7 @@ struct index_traits
typedef typename index_type::const_iterator const_index_iterator; typedef typename index_type::const_iterator const_index_iterator;
typedef typename index_type::size_type size_type; typedef typename index_type::size_type size_type;
static const size_type ExtraPointers = 3; BOOST_STATIC_CONSTEXPR size_type ExtraPointers = 3;
//Stable vector stores metadata at the end of the index (node_base_ptr vector) with additional 3 pointers: //Stable vector stores metadata at the end of the index (node_base_ptr vector) with additional 3 pointers:
// back() is this->index.back() - ExtraPointers; // back() is this->index.back() - ExtraPointers;
// end node index is *(this->index.end() - 3) // end node index is *(this->index.end() - 3)
@@ -598,7 +598,7 @@ class stable_vector
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private: private:
BOOST_COPYABLE_AND_MOVABLE(stable_vector) BOOST_COPYABLE_AND_MOVABLE(stable_vector)
static const size_type ExtraPointers = index_traits_type::ExtraPointers; BOOST_STATIC_CONSTEXPR size_type ExtraPointers = index_traits_type::ExtraPointers;
class insert_rollback; class insert_rollback;
friend class insert_rollback; friend class insert_rollback;
@@ -2255,7 +2255,7 @@ struct has_trivial_destructor_after_move<boost::container::stable_vector<T, Allo
{ {
typedef typename boost::container::stable_vector<T, Allocator>::allocator_type allocator_type; typedef typename boost::container::stable_vector<T, Allocator>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<pointer>::value;
}; };

View File

@@ -66,7 +66,7 @@ class static_storage_allocator
inline T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW inline T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
{ return move_detail::launder_cast<T*>(&storage); } { return move_detail::launder_cast<T*>(&storage); }
static const std::size_t internal_capacity = N; BOOST_STATIC_CONSTEXPR std::size_t internal_capacity = N;
std::size_t max_size() const std::size_t max_size() const
{ return N; } { return N; }
@@ -86,7 +86,7 @@ class static_storage_allocator
private: private:
BOOST_CONTAINER_STATIC_ASSERT_MSG(!InplaceAlignment || (InplaceAlignment & (InplaceAlignment-1)) == 0, "Alignment option must be zero or power of two"); BOOST_CONTAINER_STATIC_ASSERT_MSG(!InplaceAlignment || (InplaceAlignment & (InplaceAlignment-1)) == 0, "Alignment option must be zero or power of two");
static const std::size_t final_alignment = InplaceAlignment ? InplaceAlignment : dtl::alignment_of<T>::value; BOOST_STATIC_CONSTEXPR std::size_t final_alignment = InplaceAlignment ? InplaceAlignment : dtl::alignment_of<T>::value;
typename dtl::aligned_storage<sizeof(T)*N, final_alignment>::type storage; typename dtl::aligned_storage<sizeof(T)*N, final_alignment>::type storage;
}; };
@@ -188,7 +188,7 @@ public:
typedef typename base_t::const_reverse_iterator const_reverse_iterator; typedef typename base_t::const_reverse_iterator const_reverse_iterator;
//! @brief The capacity/max size of the container //! @brief The capacity/max size of the container
static const size_type static_capacity = Capacity; BOOST_STATIC_CONSTEXPR size_type static_capacity = Capacity;
//! @brief Constructs an empty static_vector. //! @brief Constructs an empty static_vector.
//! //!

View File

@@ -192,13 +192,13 @@ class basic_string_base
<sizeof(long_t), dtl::alignment_of<long_t>::value>::type long_raw_t; <sizeof(long_t), dtl::alignment_of<long_t>::value>::type long_raw_t;
protected: protected:
static const size_type MinInternalBufferChars = 8; BOOST_STATIC_CONSTEXPR size_type MinInternalBufferChars = 8;
static const size_type AlignmentOfValueType = BOOST_STATIC_CONSTEXPR size_type AlignmentOfValueType =
alignment_of<value_type>::value; alignment_of<value_type>::value;
static const size_type ShortDataOffset = ((sizeof(short_header)-1)/AlignmentOfValueType+1)*AlignmentOfValueType; BOOST_STATIC_CONSTEXPR size_type ShortDataOffset = ((sizeof(short_header)-1)/AlignmentOfValueType+1)*AlignmentOfValueType;
static const size_type ZeroCostInternalBufferChars = BOOST_STATIC_CONSTEXPR size_type ZeroCostInternalBufferChars =
(sizeof(long_t) - ShortDataOffset)/sizeof(value_type); (sizeof(long_t) - ShortDataOffset)/sizeof(value_type);
static const size_type UnalignedFinalInternalBufferChars = BOOST_STATIC_CONSTEXPR size_type UnalignedFinalInternalBufferChars =
(ZeroCostInternalBufferChars > MinInternalBufferChars) ? (ZeroCostInternalBufferChars > MinInternalBufferChars) ?
ZeroCostInternalBufferChars : MinInternalBufferChars; ZeroCostInternalBufferChars : MinInternalBufferChars;
@@ -261,11 +261,11 @@ class basic_string_base
inline allocator_type &alloc() inline allocator_type &alloc()
{ return members_; } { return members_; }
static const size_type InternalBufferChars = (sizeof(repr_t) - ShortDataOffset)/sizeof(value_type); BOOST_STATIC_CONSTEXPR size_type InternalBufferChars = (sizeof(repr_t) - ShortDataOffset)/sizeof(value_type);
private: private:
static const size_type MinAllocation = InternalBufferChars*2; BOOST_STATIC_CONSTEXPR size_type MinAllocation = InternalBufferChars*2;
protected: protected:
inline bool is_short() const inline bool is_short() const
@@ -469,7 +469,7 @@ class basic_string_base
inline void priv_short_size(size_type sz) inline void priv_short_size(size_type sz)
{ {
typedef unsigned char uchar_type; typedef unsigned char uchar_type;
static const uchar_type mask = uchar_type(uchar_type(-1) >> 1U); BOOST_STATIC_CONSTEXPR uchar_type mask = uchar_type(uchar_type(-1) >> 1U);
BOOST_ASSERT( sz <= mask ); BOOST_ASSERT( sz <= mask );
//Make -Wconversion happy //Make -Wconversion happy
this->members_.pshort_repr()->h.length = uchar_type(uchar_type(sz) & mask); this->members_.pshort_repr()->h.length = uchar_type(uchar_type(sz) & mask);
@@ -477,7 +477,7 @@ class basic_string_base
inline void priv_long_size(size_type sz) inline void priv_long_size(size_type sz)
{ {
static const size_type mask = size_type(-1) >> 1U; BOOST_STATIC_CONSTEXPR size_type mask = size_type(-1) >> 1U;
BOOST_ASSERT( sz <= mask ); BOOST_ASSERT( sz <= mask );
//Make -Wconversion happy //Make -Wconversion happy
this->members_.plong_repr()->length = sz & mask; this->members_.plong_repr()->length = sz & mask;
@@ -566,7 +566,7 @@ class basic_string
BOOST_COPYABLE_AND_MOVABLE(basic_string) BOOST_COPYABLE_AND_MOVABLE(basic_string)
typedef dtl::basic_string_base<typename real_allocator<CharT, Allocator>::type> base_t; typedef dtl::basic_string_base<typename real_allocator<CharT, Allocator>::type> base_t;
typedef typename base_t::allocator_traits_type allocator_traits_type; typedef typename base_t::allocator_traits_type allocator_traits_type;
static const typename base_t::size_type InternalBufferChars = base_t::InternalBufferChars; BOOST_STATIC_CONSTEXPR typename base_t::size_type InternalBufferChars = base_t::InternalBufferChars;
protected: protected:
// Allocator helper class to use a char_traits as a function object. // Allocator helper class to use a char_traits as a function object.
@@ -624,7 +624,7 @@ class basic_string
typedef BOOST_CONTAINER_IMPDEF(const_pointer) const_iterator; typedef BOOST_CONTAINER_IMPDEF(const_pointer) const_iterator;
typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator<iterator>) reverse_iterator; typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator<iterator>) reverse_iterator;
typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator<const_iterator>) const_reverse_iterator; typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_iterator<const_iterator>) const_reverse_iterator;
static const size_type npos = size_type(-1); BOOST_STATIC_CONSTEXPR size_type npos = size_type(-1);
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private: private:
@@ -3085,20 +3085,16 @@ wstring;
#else #else
template <class CharT, class Traits, class Allocator>
const typename basic_string<CharT,Traits,Allocator>::size_type
basic_string<CharT,Traits,Allocator>::npos;
template<class S> template<class S>
struct is_string struct is_string
{ {
static const bool value = false; BOOST_STATIC_CONSTEXPR bool value = false;
}; };
template<class C, class T, class A> template<class C, class T, class A>
struct is_string< basic_string<C, T, A> > struct is_string< basic_string<C, T, A> >
{ {
static const bool value = true; BOOST_STATIC_CONSTEXPR bool value = true;
}; };
#endif #endif
@@ -3583,8 +3579,9 @@ struct has_trivial_destructor_after_move<boost::container::basic_string<C, T, Al
{ {
typedef typename boost::container::basic_string<C, T, Allocator>::allocator_type allocator_type; typedef typename boost::container::basic_string<C, T, Allocator>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value =
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value;
}; };
} }

View File

@@ -58,7 +58,7 @@ namespace container {
//! to detect if a type should be constructed with suffix or prefix allocator arguments. //! to detect if a type should be constructed with suffix or prefix allocator arguments.
template <class T> template <class T>
struct constructible_with_allocator_suffix struct constructible_with_allocator_suffix
{ static const bool value = false; }; { BOOST_STATIC_CONSTEXPR bool value = false; };
//! <b>Remark</b>: if a specialization constructible_with_allocator_prefix<X>::value is true, indicates that T may be constructed //! <b>Remark</b>: if a specialization constructible_with_allocator_prefix<X>::value is true, indicates that T may be constructed
//! with allocator_arg and T::allocator_type as its first two constructor arguments. //! with allocator_arg and T::allocator_type as its first two constructor arguments.
@@ -108,7 +108,7 @@ struct constructible_with_allocator_suffix
//! to detect if a type should be constructed with suffix or prefix allocator arguments. //! to detect if a type should be constructed with suffix or prefix allocator arguments.
template <class T> template <class T>
struct constructible_with_allocator_prefix struct constructible_with_allocator_prefix
{ static const bool value = false; }; { BOOST_STATIC_CONSTEXPR bool value = false; };
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
@@ -142,7 +142,7 @@ struct uses_allocator_imp
static Allocator alloc; // Declared but not defined static Allocator alloc; // Declared but not defined
public: public:
static const bool value = sizeof(test<T>(alloc)) == sizeof(yes_type); BOOST_STATIC_CONSTEXPR bool value = sizeof(test<T>(alloc)) == sizeof(yes_type);
}; };
} //namespace dtl { } //namespace dtl {

View File

@@ -269,15 +269,15 @@ inline Pointer &get_ptr(vec_iterator<Pointer, IsConst> &it) BOOST_NOEXCEPT_OR_NO
struct initial_capacity_t {}; struct initial_capacity_t {};
struct vector_uninitialized_size_t {}; struct vector_uninitialized_size_t {};
static const vector_uninitialized_size_t vector_uninitialized_size = vector_uninitialized_size_t(); BOOST_CONTAINER_CONSTANT_VAR vector_uninitialized_size_t vector_uninitialized_size = vector_uninitialized_size_t();
struct maybe_initial_capacity_t {}; struct maybe_initial_capacity_t {};
template <class T> template <class T>
struct vector_value_traits_base struct vector_value_traits_base
{ {
static const bool trivial_dctr = dtl::is_trivially_destructible<T>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible<T>::value;
static const bool trivial_dctr_after_move = has_trivial_destructor_after_move<T>::value; BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = has_trivial_destructor_after_move<T>::value;
}; };
template <class Allocator> template <class Allocator>
@@ -2248,7 +2248,7 @@ private:
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
//! <b>Effects</b>: Erases all the elements of the vector. //! <b>Effects</b>: Erases all the elements of the vector. Leaves the capacity() of the vector unchanged.
//! //!
//! <b>Throws</b>: Nothing. //! <b>Throws</b>: Nothing.
//! //!
@@ -3310,8 +3310,8 @@ struct has_trivial_destructor_after_move<boost::container::vector<T, Allocator,
{ {
typedef typename boost::container::vector<T, Allocator, Options>::allocator_type allocator_type; typedef typename boost::container::vector<T, Allocator, Options>::allocator_type allocator_type;
typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer; typedef typename ::boost::container::allocator_traits<allocator_type>::pointer pointer;
static const bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value && BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move<allocator_type>::value &&
::boost::has_trivial_destructor_after_move<pointer>::value; ::boost::has_trivial_destructor_after_move<pointer>::value;
}; };
} }