diff --git a/include/boost/container/adaptive_pool.hpp b/include/boost/container/adaptive_pool.hpp index 9b10cb47..a6a89fa5 100644 --- a/include/boost/container/adaptive_pool.hpp +++ b/include/boost/container/adaptive_pool.hpp @@ -71,10 +71,10 @@ class adaptive_pool BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version) > self_t; - static const std::size_t nodes_per_block = NodesPerBlock; - static const std::size_t max_free_blocks = MaxFreeBlocks; - static const std::size_t overhead_percent = OverheadPercent; - static const std::size_t real_nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t max_free_blocks = MaxFreeBlocks; + BOOST_STATIC_CONSTEXPR std::size_t overhead_percent = OverheadPercent; + BOOST_STATIC_CONSTEXPR std::size_t real_nodes_per_block = NodesPerBlock; BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2))); @@ -384,10 +384,10 @@ class private_adaptive_pool BOOST_CONTAINER_DOCIGN(BOOST_MOVE_I Version) > self_t; - static const std::size_t nodes_per_block = NodesPerBlock; - static const std::size_t max_free_blocks = MaxFreeBlocks; - static const std::size_t overhead_percent = OverheadPercent; - static const std::size_t real_nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t max_free_blocks = MaxFreeBlocks; + BOOST_STATIC_CONSTEXPR std::size_t overhead_percent = OverheadPercent; + BOOST_STATIC_CONSTEXPR std::size_t real_nodes_per_block = NodesPerBlock; BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_STATIC_ASSERT((Version <=2))); diff --git a/include/boost/container/allocator.hpp b/include/boost/container/allocator.hpp index 33c2a8a4..68a158c0 100644 --- a/include/boost/container/allocator.hpp +++ b/include/boost/container/allocator.hpp @@ -115,7 +115,7 @@ class allocator template allocator& operator=(const allocator&); - static const unsigned int ForbiddenMask = + BOOST_STATIC_CONSTEXPR unsigned int ForbiddenMask = BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ; //The mask can't disable all the allocation types diff --git a/include/boost/container/allocator_traits.hpp b/include/boost/container/allocator_traits.hpp index 8e2fafa7..1fefda53 100644 --- a/include/boost/container/allocator_traits.hpp +++ b/include/boost/container/allocator_traits.hpp @@ -240,19 +240,19 @@ namespace dtl { //supporting rvalue references template struct is_std_allocator -{ static const bool value = false; }; +{ BOOST_STATIC_CONSTEXPR bool value = false; }; template struct is_std_allocator< std::allocator > -{ static const bool value = true; }; +{ BOOST_STATIC_CONSTEXPR bool value = true; }; template struct is_std_allocator< small_vector_allocator, Options > > -{ static const bool value = true; }; +{ BOOST_STATIC_CONSTEXPR bool value = true; }; template struct is_not_std_allocator -{ static const bool value = !is_std_allocator::value; }; +{ BOOST_STATIC_CONSTEXPR bool value = !is_std_allocator::value; }; BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(pointer) BOOST_INTRUSIVE_INSTANTIATE_EVAL_DEFAULT_TYPE_TMPLT(const_pointer) @@ -498,7 +498,7 @@ struct allocator_traits template 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 , boost::container::dtl::has_member_function_callable_with_construct < Allocator, T*, Args... > @@ -567,7 +567,7 @@ struct allocator_traits template\ 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 \ , boost::container::dtl::has_member_function_callable_with_construct \ < Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_FWD_T##N > \ diff --git a/include/boost/container/container_fwd.hpp b/include/boost/container/container_fwd.hpp index 9e82fdef..0ab5ace6 100644 --- a/include/boost/container/container_fwd.hpp +++ b/include/boost/container/container_fwd.hpp @@ -277,10 +277,10 @@ class basic_string; typedef basic_string string; typedef basic_string wstring; -static const std::size_t ADP_nodes_per_block = 256u; -static const std::size_t ADP_max_free_blocks = 2u; -static const std::size_t ADP_overhead_percent = 1u; -static const std::size_t ADP_only_alignment = 0u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_nodes_per_block = 256u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_max_free_blocks = 2u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_overhead_percent = 1u; +BOOST_STATIC_CONSTEXPR std::size_t ADP_only_alignment = 0u; template < class T , std::size_t NodesPerBlock = ADP_nodes_per_block @@ -295,7 +295,7 @@ template < class T , unsigned int AllocationDisableMask = 0> class allocator; -static const std::size_t NodeAlloc_nodes_per_block = 256u; +BOOST_STATIC_CONSTEXPR std::size_t NodeAlloc_nodes_per_block = 256u; template < class T diff --git a/include/boost/container/deque.hpp b/include/boost/container/deque.hpp index 188f65a2..da24ad0d 100644 --- a/include/boost/container/deque.hpp +++ b/include/boost/container/deque.hpp @@ -68,16 +68,16 @@ template struct deque_value_traits { typedef T value_type; - static const bool trivial_dctr = dtl::is_trivially_destructible::value; - static const bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = ::boost::has_trivial_destructor_after_move::value; }; template struct deque_block_size { 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; - 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 block_bytes = BlockBytes ? BlockBytes : 512u; + BOOST_STATIC_CONSTEXPR std::size_t value = BlockSize ? BlockSize : (sizeof(T) < block_bytes ? (block_bytes/sizeof(T)) : std::size_t(1)); }; namespace dtl { @@ -2870,7 +2870,7 @@ struct has_trivial_destructor_after_move::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/include/boost/container/detail/adaptive_node_pool.hpp b/include/boost/container/detail/adaptive_node_pool.hpp index 9dd89b13..816b95d1 100644 --- a/include/boost/container/detail/adaptive_node_pool.hpp +++ b/include/boost/container/detail/adaptive_node_pool.hpp @@ -76,7 +76,7 @@ class private_adaptive_node_pool private_adaptive_node_pool &operator=(const private_adaptive_node_pool &); public: - static const std::size_t nodes_per_block = NodesPerBlock; + BOOST_STATIC_CONSTEXPR std::size_t nodes_per_block = NodesPerBlock; //!Constructor. Never throws private_adaptive_node_pool() diff --git a/include/boost/container/detail/adaptive_node_pool_impl.hpp b/include/boost/container/detail/adaptive_node_pool_impl.hpp index e3400977..46d9ec39 100644 --- a/include/boost/container/detail/adaptive_node_pool_impl.hpp +++ b/include/boost/container/detail/adaptive_node_pool_impl.hpp @@ -213,11 +213,11 @@ template block_container_traits_t; typedef typename block_container_traits_t::hook_t hook_t; typedef hdr_offset_holder_t 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; struct block_info_t @@ -253,11 +253,11 @@ template< std::size_t alignment , std::size_t overhead_percent> 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; - static const 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; - static const 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 hdr_subblock_elements_alone = (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; + BOOST_STATIC_CONSTEXPR 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_end = (alignment - hdr_offset_size - payload_per_allocation)/real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t num_b_subblock = hdr_subblock_elements_alone >= min_elements_per_block ? 0 : ( ((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 : ( (num_b_subblock == 1) ? (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) ) ; - static const std::size_t total_data = total_nodes*real_node_size; - static const 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 std::size_t total_data = total_nodes*real_node_size; + BOOST_STATIC_CONSTEXPR std::size_t total_size = alignment*(num_b_subblock+1); + BOOST_STATIC_CONSTEXPR bool overhead_satisfied = (total_size - total_data)*100/total_size < overhead_percent; }; template< std::size_t initial_alignment @@ -299,7 +299,7 @@ struct candidate_power_of_2_ct , hdr_offset_size , 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 < candidate_power_of_2 @@ -312,9 +312,9 @@ struct candidate_power_of_2_ct , !helper_t::overhead_satisfied >::type type; - static const std::size_t alignment = type::alignment; - static const 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 alignment = type::alignment; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = type::num_subblocks; + BOOST_STATIC_CONSTEXPR std::size_t real_num_node = type::real_num_node; }; template< std::size_t initial_alignment @@ -354,9 +354,9 @@ struct candidate_power_of_2_ct , hdr_offset_size , overhead_percent> helper_t; - static const std::size_t alignment = initial_alignment; - static const 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 alignment = initial_alignment; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = helper_t::num_b_subblock+1; + 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; //Flags //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_ IsAlignOnly; typedef true_ AlignOnlyTrue; typedef false_ AlignOnlyFalse; typedef typename SegmentManagerBase::void_pointer void_pointer; - static const typename SegmentManagerBase:: + BOOST_STATIC_CONSTEXPR typename SegmentManagerBase:: size_type PayloadPerAllocation = SegmentManagerBase::PayloadPerAllocation; 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 private_adaptive_node_pool_impl_common this_type; - static const size_type MaxAlign = alignment_of::value; - static const 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 MaxAlign = alignment_of::value; + BOOST_STATIC_CONSTEXPR size_type HdrSize = ((sizeof(block_info_t)-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 block_container_t m_block_container; //Intrusive block list @@ -981,9 +981,9 @@ template< class SizeType , bool AlignOnly> struct calculate_alignment_ct { - static const std::size_t alignment = upper_power_of_2_ct::value; - static const std::size_t num_subblocks = 0; - static const std::size_t real_num_node = (alignment - PayloadPerAllocation - HdrSize)/RealNodeSize; + BOOST_STATIC_CONSTEXPR std::size_t alignment = upper_power_of_2_ct::value; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = 0; + BOOST_STATIC_CONSTEXPR std::size_t real_num_node = (alignment - PayloadPerAllocation - HdrSize)/RealNodeSize; }; template< class SizeType @@ -1013,9 +1013,9 @@ struct calculate_alignment_ct , OverheadPercent >::type type; - static const std::size_t alignment = type::alignment; - static const 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 alignment = type::alignment; + BOOST_STATIC_CONSTEXPR std::size_t num_subblocks = type::num_subblocks; + 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::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 - static const bool AlignOnly = base_t::AlignOnly; + BOOST_STATIC_CONSTEXPR bool AlignOnly = base_t::AlignOnly; private: - static const size_type MaxAlign = base_t::MaxAlign; - static const size_type HdrSize = base_t::HdrSize; - static const size_type HdrOffsetSize = base_t::HdrOffsetSize; + BOOST_STATIC_CONSTEXPR size_type MaxAlign = base_t::MaxAlign; + BOOST_STATIC_CONSTEXPR size_type HdrSize = base_t::HdrSize; + BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = base_t::HdrOffsetSize; - static const size_type RealNodeSize = lcm_ct::value>::value; + BOOST_STATIC_CONSTEXPR size_type RealNodeSize = lcm_ct::value>::value; typedef calculate_alignment_ct < size_type, HdrSize, PayloadPerAllocation @@ -1065,9 +1065,9 @@ class private_adaptive_node_pool_impl_ct //Round the size to a power of two value. //This is the total memory size (including payload) that we want to //allocate from the general-purpose allocator - static const size_type NumSubBlocks = data_t::num_subblocks; - static const size_type RealNumNode = data_t::real_num_node; - static const size_type RealBlockAlignment = data_t::alignment; + BOOST_STATIC_CONSTEXPR size_type NumSubBlocks = data_t::num_subblocks; + BOOST_STATIC_CONSTEXPR size_type RealNumNode = data_t::real_num_node; + BOOST_STATIC_CONSTEXPR size_type RealBlockAlignment = data_t::alignment; public: @@ -1165,14 +1165,14 @@ class private_adaptive_node_pool_impl_rt typedef typename impl_t::size_type size_type; 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 //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; - static const size_type HdrOffsetSize = impl_t::HdrOffsetSize; + BOOST_STATIC_CONSTEXPR size_type HdrSize = impl_t::HdrSize; + BOOST_STATIC_CONSTEXPR size_type HdrOffsetSize = impl_t::HdrOffsetSize; public: diff --git a/include/boost/container/detail/advanced_insert_int.hpp b/include/boost/container/detail/advanced_insert_int.hpp index 5cc1c1c7..e16082a7 100644 --- a/include/boost/container/detail/advanced_insert_int.hpp +++ b/include/boost/container/detail/advanced_insert_int.hpp @@ -182,7 +182,7 @@ struct insert_copy_proxy typedef boost::container::allocator_traits alloc_traits; 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) : v_(v) @@ -212,7 +212,7 @@ struct insert_move_proxy typedef boost::container::allocator_traits alloc_traits; 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) : v_(v) @@ -265,7 +265,7 @@ struct insert_nonmovable_emplace_proxy typedef typename alloc_traits::value_type value_type; typedef typename build_number_seq::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) : args_(args...) @@ -296,7 +296,7 @@ struct insert_emplace_proxy typedef typename base_t::value_type value_type; 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) : base_t(::boost::forward(args)...) @@ -332,7 +332,7 @@ template struct insert_emplace_proxy::value_type> : public insert_move_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; inline explicit insert_emplace_proxy(typename boost::container::allocator_traits::value_type &&v) : insert_move_proxy(v) @@ -349,7 +349,7 @@ struct insert_emplace_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) @@ -360,7 +360,7 @@ template struct insert_emplace_proxy::value_type &> : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) @@ -373,7 +373,7 @@ struct insert_emplace_proxy : public insert_copy_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; inline explicit insert_emplace_proxy(const typename boost::container::allocator_traits::value_type &v) : insert_copy_proxy(v) @@ -397,7 +397,7 @@ struct insert_nonmovable_emplace_proxy##N\ typedef boost::container::allocator_traits alloc_traits;\ 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)\ 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 boost::container::allocator_traits 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)\ : base_t(BOOST_MOVE_FWD##N){}\ @@ -460,7 +460,7 @@ template struct insert_emplace_proxy_arg1::value_type> > : public insert_move_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &v) : insert_move_proxy(v) @@ -471,7 +471,7 @@ template struct insert_emplace_proxy_arg1::value_type> : public insert_copy_proxy { - 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::value_type &v) : insert_copy_proxy(v) @@ -485,7 +485,7 @@ template struct insert_emplace_proxy_arg1::value_type> : public insert_move_proxy { - static const bool single_value = true; + BOOST_STATIC_CONSTEXPR bool single_value = true; inline explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &&v) : insert_move_proxy(v) @@ -501,7 +501,7 @@ struct insert_emplace_proxy_arg1 : public insert_copy_proxy { - 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::value_type &v) : insert_copy_proxy(v) @@ -512,7 +512,7 @@ template struct insert_emplace_proxy_arg1::value_type &> : public insert_copy_proxy { - 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::value_type &v) : insert_copy_proxy(v) @@ -525,7 +525,7 @@ struct insert_emplace_proxy_arg1 : public insert_copy_proxy { - 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::value_type &v) : insert_copy_proxy(v) diff --git a/include/boost/container/detail/block_list.hpp b/include/boost/container/detail/block_list.hpp index 0ed0e227..48523267 100644 --- a/include/boost/container/detail/block_list.hpp +++ b/include/boost/container/detail/block_list.hpp @@ -74,11 +74,11 @@ class block_list_base { 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: - 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() { list_algo::init_header(&m_list); } diff --git a/include/boost/container/detail/block_slist.hpp b/include/boost/container/detail/block_slist.hpp index 890e7258..b265ba44 100644 --- a/include/boost/container/detail/block_slist.hpp +++ b/include/boost/container/detail/block_slist.hpp @@ -68,11 +68,11 @@ class block_slist_base { 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: - 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() { slist_algo::init_header(&m_slist); } diff --git a/include/boost/container/detail/copy_move_algo.hpp b/include/boost/container/detail/copy_move_algo.hpp index a4d72e7e..c10edf1b 100644 --- a/include/boost/container/detail/copy_move_algo.hpp +++ b/include/boost/container/detail/copy_move_algo.hpp @@ -64,7 +64,7 @@ namespace dtl { template struct are_elements_contiguous { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; ///////////////////////// @@ -74,7 +74,7 @@ struct are_elements_contiguous template struct are_elements_contiguous { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; ///////////////////////// @@ -115,7 +115,7 @@ namespace dtl { template struct are_elements_contiguous > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; @@ -126,7 +126,7 @@ struct are_elements_contiguous template struct are_elements_contiguous< ::boost::interprocess::offset_ptr > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template @@ -185,20 +185,20 @@ struct has_single_value template static two test(int, ...); template static char test(int, const wrapper*); public: - static const bool value = sizeof(test(0, 0)) == 1; + BOOST_STATIC_CONSTEXPR bool value = sizeof(test(0, 0)) == 1; void dummy() {} }; template::value> struct is_single_value_proxy_impl { - static const bool value = InsertionProxy::single_value; + BOOST_STATIC_CONSTEXPR bool value = InsertionProxy::single_value; }; template struct is_single_value_proxy_impl { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -293,7 +293,7 @@ template struct is_memzero_initializable { typedef typename ::boost::container::iterator_traits::value_type value_type; - static const bool value = are_elements_contiguous::value && + BOOST_STATIC_CONSTEXPR bool value = are_elements_contiguous::value && ( dtl::is_integral::value || dtl::is_enum::value #if defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL) || dtl::is_pointer::value @@ -1496,8 +1496,8 @@ void expand_backward_forward_and_insert_alloc_move_backward { typedef std::size_t size_type; typedef typename allocator_traits::value_type value_type; - static const bool trivial_dctr_after_move = has_trivial_destructor_after_move::value; - static const bool trivial_dctr = dtl::is_trivially_destructible::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible::value; typedef typename dtl::if_c ::value_type value_type; - static const bool trivial_dctr_after_move = has_trivial_destructor_after_move::value; - static const bool trivial_dctr = dtl::is_trivially_destructible::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible::value; typedef typename dtl::if_c static no_type test(...); - static const bool value = sizeof(test(0)) == sizeof(yes_type); + BOOST_STATIC_CONSTEXPR bool value = sizeof(test(0)) == sizeof(yes_type); }; template diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index f3812295..93cdb61b 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -583,7 +583,7 @@ class flat_tree (boost::container::dtl::, container_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); private: @@ -1700,7 +1700,7 @@ struct has_trivial_destructor_after_move flat_tree; typedef typename flat_tree::container_type container_type; typedef typename flat_tree::key_compare key_compare; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/include/boost/container/detail/function_detector.hpp b/include/boost/container/detail/function_detector.hpp index 00caced5..33134cb0 100644 --- a/include/boost/container/detail/function_detector.hpp +++ b/include/boost/container/detail/function_detector.hpp @@ -80,7 +80,7 @@ namespace function_detector { template \ static NotFoundType Test( ... ); \ public : \ - static const int check = NotFound + (sizeof(Test(0, 0)) - sizeof(NotFoundType));\ + BOOST_STATIC_CONSTEXPR int check = NotFound + (sizeof(Test(0, 0)) - sizeof(NotFoundType));\ };\ }}} //namespace boost::container::function_detector { diff --git a/include/boost/container/detail/is_container.hpp b/include/boost/container/detail/is_container.hpp index 8ef0274d..fe44b465 100644 --- a/include/boost/container/detail/is_container.hpp +++ b/include/boost/container/detail/is_container.hpp @@ -51,7 +51,7 @@ namespace dtl { template struct is_container { - static const bool value = + BOOST_STATIC_CONSTEXPR bool value = boost::container::is_container_detail:: has_member_function_callable_with_size ::value && boost::container::is_container_detail:: @@ -61,7 +61,7 @@ struct is_container template <> struct is_container { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; diff --git a/include/boost/container/detail/is_contiguous_container.hpp b/include/boost/container/detail/is_contiguous_container.hpp index 045de843..2688f809 100644 --- a/include/boost/container/detail/is_contiguous_container.hpp +++ b/include/boost/container/detail/is_contiguous_container.hpp @@ -51,7 +51,7 @@ namespace dtl { template struct is_contiguous_container { - static const bool value = + BOOST_STATIC_CONSTEXPR bool value = boost::container::is_contiguous_container_detail:: has_member_function_callable_with_data::value && boost::container::is_contiguous_container_detail:: diff --git a/include/boost/container/detail/is_pair.hpp b/include/boost/container/detail/is_pair.hpp index 239e36e1..ddb63b68 100644 --- a/include/boost/container/detail/is_pair.hpp +++ b/include/boost/container/detail/is_pair.hpp @@ -61,25 +61,25 @@ struct pair; template struct is_pair { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template struct is_pair< pair > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template struct is_pair< std::pair > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template struct is_not_pair { - static const bool value = !is_pair::value; + BOOST_STATIC_CONSTEXPR bool value = !is_pair::value; }; } //namespace dtl { diff --git a/include/boost/container/detail/iterators.hpp b/include/boost/container/detail/iterators.hpp index 57ffb0ce..82daac46 100644 --- a/include/boost/container/detail/iterators.hpp +++ b/include/boost/container/detail/iterators.hpp @@ -723,50 +723,50 @@ struct has_iterator_category template static two test(int, ...); - static const bool value = (1 == sizeof(test(0, 0))); + BOOST_STATIC_CONSTEXPR bool value = (1 == sizeof(test(0, 0))); }; template::value > struct is_input_iterator { - static const bool value = is_same::value; + BOOST_STATIC_CONSTEXPR bool value = is_same::value; }; template struct is_input_iterator { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template struct is_not_input_iterator { - static const bool value = !is_input_iterator::value; + BOOST_STATIC_CONSTEXPR bool value = !is_input_iterator::value; }; template::value > struct is_forward_iterator { - static const bool value = is_same::value; + BOOST_STATIC_CONSTEXPR bool value = is_same::value; }; template struct is_forward_iterator { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template::value > struct is_bidirectional_iterator { - static const bool value = is_same::value; + BOOST_STATIC_CONSTEXPR bool value = is_same::value; }; template struct is_bidirectional_iterator { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template diff --git a/include/boost/container/detail/math_functions.hpp b/include/boost/container/detail/math_functions.hpp index b84ef6a1..e9a91652 100644 --- a/include/boost/container/detail/math_functions.hpp +++ b/include/boost/container/detail/math_functions.hpp @@ -100,7 +100,7 @@ struct upper_power_of_2_loop_ct template struct apply { - static const Integer value = + BOOST_STATIC_CONSTEXPR Integer value = upper_power_of_2_loop_ct P*2)>::template apply::value; }; }; @@ -111,14 +111,14 @@ struct upper_power_of_2_loop_ct template struct apply { - static const Integer value = P; + BOOST_STATIC_CONSTEXPR Integer value = P; }; }; template struct upper_power_of_2_ct { - static const Integer value = upper_power_of_2_loop_ct 1)>::template apply::value; + BOOST_STATIC_CONSTEXPR Integer value = upper_power_of_2_loop_ct 1)>::template apply::value; }; //This function uses binary search to discover the @@ -144,27 +144,27 @@ inline std::size_t floor_log2 (std::size_t x) template struct gcd_ct { - static const std::size_t Max = I1 > I2 ? I1 : I2; - static const std::size_t Min = I1 < I2 ? I1 : I2; - static const std::size_t value = gcd_ct::value; + BOOST_STATIC_CONSTEXPR std::size_t Max = I1 > I2 ? I1 : I2; + BOOST_STATIC_CONSTEXPR std::size_t Min = I1 < I2 ? I1 : I2; + BOOST_STATIC_CONSTEXPR std::size_t value = gcd_ct::value; }; template struct gcd_ct { - static const std::size_t value = I1; + BOOST_STATIC_CONSTEXPR std::size_t value = I1; }; template struct gcd_ct<0, I1> { - static const std::size_t value = I1; + BOOST_STATIC_CONSTEXPR std::size_t value = I1; }; template struct lcm_ct { - static const std::size_t value = I1 * I2 / gcd_ct::value; + BOOST_STATIC_CONSTEXPR std::size_t value = I1 * I2 / gcd_ct::value; }; } // namespace dtl diff --git a/include/boost/container/detail/mpl.hpp b/include/boost/container/detail/mpl.hpp index ffae180c..7662e4cc 100644 --- a/include/boost/container/detail/mpl.hpp +++ b/include/boost/container/detail/mpl.hpp @@ -84,13 +84,13 @@ struct void_t { typedef void type; }; template struct is_transparent_base { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template struct is_transparent_base::type> { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template @@ -112,7 +112,7 @@ template using variadic_void_t = void; template struct is_allocator { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -123,7 +123,7 @@ struct is_allocator < Allocator, variadic_void_t< typename Allocator::value_type , decltype(ctad_declval().allocate(size_t{})) >> { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template diff --git a/include/boost/container/detail/node_pool.hpp b/include/boost/container/detail/node_pool.hpp index 64907727..f0e12353 100644 --- a/include/boost/container/detail/node_pool.hpp +++ b/include/boost/container/detail/node_pool.hpp @@ -52,7 +52,7 @@ class private_node_pool public: 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 private_node_pool() diff --git a/include/boost/container/detail/pair.hpp b/include/boost/container/detail/pair.hpp index 58e56081..190af3a1 100644 --- a/include/boost/container/detail/pair.hpp +++ b/include/boost/container/detail/pair.hpp @@ -46,7 +46,7 @@ namespace pair_impl { template struct is_boost_tuple { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template < @@ -56,7 +56,7 @@ template < class T9> struct is_boost_tuple< boost::tuples::tuple > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template @@ -67,13 +67,13 @@ struct disable_if_boost_tuple template struct is_tuple_null { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template<> struct is_tuple_null { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; } //namespace detail { @@ -482,7 +482,7 @@ inline void swap(pair& x, pair& y) template struct has_move_emulation_enabled< ::boost::container::dtl::pair > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; #endif @@ -497,7 +497,7 @@ struct is_class_or_union< ::boost::container::dtl::pair > //This specialization is needed to avoid instantiation of pair in //is_class, and allow recursive maps. { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template @@ -505,7 +505,7 @@ struct is_class_or_union< std::pair > //This specialization is needed to avoid instantiation of pair in //is_class, and allow recursive maps. { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template @@ -516,7 +516,7 @@ struct is_union< ::boost::container::dtl::pair > //This specialization is needed to avoid instantiation of pair in //is_class, and allow recursive maps. { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -524,7 +524,7 @@ struct is_union< std::pair > //This specialization is needed to avoid instantiation of pair in //is_class, and allow recursive maps. { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -535,7 +535,7 @@ struct is_class< ::boost::container::dtl::pair > //This specialization is needed to avoid instantiation of pair in //is_class, and allow recursive maps. { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; template @@ -543,7 +543,7 @@ struct is_class< std::pair > //This specialization is needed to avoid instantiation of pair in //is_class, and allow recursive maps. { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; @@ -555,7 +555,7 @@ template struct is_trivially_copy_assignable > { - static const bool value = false ; + BOOST_STATIC_CONSTEXPR bool value = false ; }; template @@ -565,7 +565,7 @@ template struct is_trivially_move_assignable > { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -574,7 +574,7 @@ struct is_trivially_copy_assignable; template struct is_trivially_copy_constructible > { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -583,7 +583,7 @@ struct is_trivially_move_assignable; template struct is_trivially_move_constructible > { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template @@ -592,7 +592,7 @@ struct is_trivially_destructible; template struct is_trivially_destructible > { - static const bool value = boost::move_detail::is_trivially_destructible::value && + BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_destructible::value && boost::move_detail::is_trivially_destructible::value ; }; diff --git a/include/boost/container/detail/pool_common.hpp b/include/boost/container/detail/pool_common.hpp index f42c1dd4..8a570328 100644 --- a/include/boost/container/detail/pool_common.hpp +++ b/include/boost/container/detail/pool_common.hpp @@ -45,7 +45,7 @@ struct node_slist template struct is_stateless_segment_manager { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; } //namespace dtl { diff --git a/include/boost/container/detail/pool_common_alloc.hpp b/include/boost/container/detail/pool_common_alloc.hpp index f58c5e7a..bc5cd7b7 100644 --- a/include/boost/container/detail/pool_common_alloc.hpp +++ b/include/boost/container/detail/pool_common_alloc.hpp @@ -39,7 +39,7 @@ struct node_slist_helper struct fake_segment_manager { 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:: basic_multiallocation_chain multiallocation_chain; @@ -90,7 +90,7 @@ template<> struct is_stateless_segment_manager { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; } //namespace dtl { diff --git a/include/boost/container/detail/tree.hpp b/include/boost/container/detail/tree.hpp index 5c0c3832..a1896519 100644 --- a/include/boost/container/detail/tree.hpp +++ b/include/boost/container/detail/tree.hpp @@ -251,13 +251,13 @@ struct intrusive_tree_type //Trait to detect manually rebalanceable tree types template struct is_manually_balanceable -{ static const bool value = true; }; +{ BOOST_STATIC_CONSTEXPR bool value = true; }; template<> struct is_manually_balanceable -{ static const bool value = false; }; +{ BOOST_STATIC_CONSTEXPR bool value = false; }; template<> struct is_manually_balanceable -{ static const bool value = false; }; +{ BOOST_STATIC_CONSTEXPR bool value = false; }; //Proxy traits to implement different operations depending on the //is_manually_balanceable<>::value @@ -1433,9 +1433,10 @@ struct has_trivial_destructor_after_move { typedef typename ::boost::container::dtl::tree::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && - ::boost::has_trivial_destructor_after_move::value && - ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = + ::boost::has_trivial_destructor_after_move::value && + ::boost::has_trivial_destructor_after_move::value && + ::boost::has_trivial_destructor_after_move::value; }; } //namespace boost { diff --git a/include/boost/container/detail/version_type.hpp b/include/boost/container/detail/version_type.hpp index 389606a5..e02244ac 100644 --- a/include/boost/container/detail/version_type.hpp +++ b/include/boost/container/detail/version_type.hpp @@ -57,20 +57,20 @@ struct has_version template static two test(...); template static char test(const typename U::version*); public: - static const bool value = sizeof(test(0)) == 1; + BOOST_STATIC_CONSTEXPR bool value = sizeof(test(0)) == 1; void dummy(){} }; template ::value> struct version { - static const unsigned value = 1; + BOOST_STATIC_CONSTEXPR unsigned value = 1; }; template struct version { - static const unsigned value = extract_version::type::value; + BOOST_STATIC_CONSTEXPR unsigned value = extract_version::type::value; }; } //namespace impl @@ -83,7 +83,7 @@ struct version template struct is_version { - static const bool value = + BOOST_STATIC_CONSTEXPR bool value = is_same< typename version::type, integral_constant >::value; }; diff --git a/include/boost/container/devector.hpp b/include/boost/container/devector.hpp index 1020c5d4..216641ce 100644 --- a/include/boost/container/devector.hpp +++ b/include/boost/container/devector.hpp @@ -147,7 +147,7 @@ class devector typedef typename get_devector_opt::type options_type; typedef typename options_type::growth_factor_type growth_factor_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; #endif // ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -3030,8 +3030,9 @@ struct has_trivial_destructor_after_move::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && - ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = + ::boost::has_trivial_destructor_after_move::value && + ::boost::has_trivial_destructor_after_move::value; }; } diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index 09a2c254..7ebfc436 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -1768,7 +1768,7 @@ struct has_trivial_destructor_after_move value_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind::type alloc_or_cont_t; typedef ::boost::container::dtl::flat_tree, Compare, alloc_or_cont_t> tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { @@ -3102,7 +3102,7 @@ struct has_trivial_destructor_after_move< boost::container::flat_multimap value_t; typedef typename ::boost::container::dtl::container_or_allocator_rebind::type alloc_or_cont_t; typedef ::boost::container::dtl::flat_tree, Compare, alloc_or_cont_t> tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; } //namespace boost { diff --git a/include/boost/container/flat_set.hpp b/include/boost/container/flat_set.hpp index 0c02dab7..caffd163 100644 --- a/include/boost/container/flat_set.hpp +++ b/include/boost/container/flat_set.hpp @@ -1201,7 +1201,7 @@ template struct has_trivial_destructor_after_move > { typedef ::boost::container::dtl::flat_tree, Compare, AllocatorOrContainer> tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { @@ -1932,7 +1932,7 @@ template struct has_trivial_destructor_after_move > { typedef ::boost::container::dtl::flat_tree, Compare, AllocatorOrContainer> tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { diff --git a/include/boost/container/list.hpp b/include/boost/container/list.hpp index 6dbd71be..e597c487 100644 --- a/include/boost/container/list.hpp +++ b/include/boost/container/list.hpp @@ -1504,7 +1504,7 @@ struct has_trivial_destructor_after_move > { typedef typename boost::container::list::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/include/boost/container/map.hpp b/include/boost/container/map.hpp index 80f04aab..69c05266 100644 --- a/include/boost/container/map.hpp +++ b/include/boost/container/map.hpp @@ -1376,7 +1376,7 @@ template struct has_trivial_destructor_after_move > { typedef ::boost::container::dtl::tree, int, Compare, Allocator, Options> tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { @@ -2298,7 +2298,7 @@ template struct has_trivial_destructor_after_move > { typedef ::boost::container::dtl::tree, int, Compare, Allocator, Options> tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { diff --git a/include/boost/container/new_allocator.hpp b/include/boost/container/new_allocator.hpp index b01b9ba8..1dadb2b7 100644 --- a/include/boost/container/new_allocator.hpp +++ b/include/boost/container/new_allocator.hpp @@ -33,7 +33,7 @@ namespace container { template struct new_allocator_bool -{ static const bool value = Value; }; +{ BOOST_STATIC_CONSTEXPR bool value = Value; }; template class new_allocator; diff --git a/include/boost/container/node_allocator.hpp b/include/boost/container/node_allocator.hpp index ff24959f..14c37541 100644 --- a/include/boost/container/node_allocator.hpp +++ b/include/boost/container/node_allocator.hpp @@ -63,7 +63,7 @@ class node_allocator typedef unsigned int allocation_type; typedef node_allocator 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)); #endif diff --git a/include/boost/container/options.hpp b/include/boost/container/options.hpp index ce00b48f..dad41b7a 100644 --- a/include/boost/container/options.hpp +++ b/include/boost/container/options.hpp @@ -52,8 +52,8 @@ enum tree_type_enum template struct tree_opt { - static const boost::container::tree_type_enum tree_type = TreeType; - static const bool optimize_size = OptimizeSize; + BOOST_STATIC_CONSTEXPR boost::container::tree_type_enum tree_type = TreeType; + BOOST_STATIC_CONSTEXPR bool optimize_size = OptimizeSize; }; typedef tree_opt tree_assoc_defaults; @@ -116,10 +116,10 @@ using tree_assoc_options_t = typename boost::container::tree_assoc_options struct hash_opt { - static const bool store_hash = StoreHash; - static const bool cache_begin = CacheBegin; - static const bool linear_buckets = LinearBuckets; - static const bool fastmod_buckets = FastmodBuckets; + BOOST_STATIC_CONSTEXPR bool store_hash = StoreHash; + BOOST_STATIC_CONSTEXPR bool cache_begin = CacheBegin; + BOOST_STATIC_CONSTEXPR bool linear_buckets = LinearBuckets; + BOOST_STATIC_CONSTEXPR bool fastmod_buckets = FastmodBuckets; }; typedef hash_opt hash_assoc_defaults; @@ -203,13 +203,13 @@ struct default_if_void template struct default_if_zero { - static const std::size_t value = N; + BOOST_STATIC_CONSTEXPR std::size_t value = N; }; template 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 struct small_vector_opt { 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 small_vector_null_opt; @@ -430,8 +430,8 @@ BOOST_INTRUSIVE_OPTION_CONSTANT(throw_on_overflow, bool, ThrowOnOverflow, throw_ template struct static_vector_opt { - static const bool throw_on_overflow = ThrowOnOverflow; - static const std::size_t inplace_alignment = InplaceAlignment; + BOOST_STATIC_CONSTEXPR bool throw_on_overflow = ThrowOnOverflow; + BOOST_STATIC_CONSTEXPR std::size_t inplace_alignment = InplaceAlignment; }; typedef static_vector_opt static_vector_null_opt; @@ -515,7 +515,7 @@ template struct devector_opt : vector_opt { - static const std::size_t free_fraction = FreeFraction; + BOOST_STATIC_CONSTEXPR std::size_t free_fraction = FreeFraction; }; typedef devector_opt devector_null_opt; @@ -606,8 +606,8 @@ using devector_options_t = typename boost::container::devector_options struct deque_opt { - static const std::size_t block_bytes = BlockBytes; - static const std::size_t block_size = BlockSize; + BOOST_STATIC_CONSTEXPR std::size_t block_bytes = BlockBytes; + 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"); }; diff --git a/include/boost/container/pmr/memory_resource.hpp b/include/boost/container/pmr/memory_resource.hpp index 4187f05f..b54e75f2 100644 --- a/include/boost/container/pmr/memory_resource.hpp +++ b/include/boost/container/pmr/memory_resource.hpp @@ -32,7 +32,7 @@ class memory_resource { public: // 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::value; //! Effects: Destroys diff --git a/include/boost/container/pmr/monotonic_buffer_resource.hpp b/include/boost/container/pmr/monotonic_buffer_resource.hpp index 6799f4f2..a52bbf88 100644 --- a/include/boost/container/pmr/monotonic_buffer_resource.hpp +++ b/include/boost/container/pmr/monotonic_buffer_resource.hpp @@ -70,7 +70,7 @@ class BOOST_CONTAINER_DECL monotonic_buffer_resource //! to the upstream allocator //! //! Note: 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*); //! Requires: `upstream` shall be the address of a valid memory resource or `nullptr` //! diff --git a/include/boost/container/pmr/resource_adaptor.hpp b/include/boost/container/pmr/resource_adaptor.hpp index 78f1bd39..e53a7209 100644 --- a/include/boost/container/pmr/resource_adaptor.hpp +++ b/include/boost/container/pmr/resource_adaptor.hpp @@ -36,19 +36,19 @@ namespace pmr_dtl { template struct max_allocator_alignment { - static const std::size_t value = 1; + BOOST_STATIC_CONSTEXPR std::size_t value = 1; }; template struct max_allocator_alignment< ::boost::container::new_allocator > { - static const std::size_t value = boost::move_detail::alignment_of::value; + BOOST_STATIC_CONSTEXPR std::size_t value = boost::move_detail::alignment_of::value; }; template struct max_allocator_alignment< std::allocator > { - static const std::size_t value = boost::move_detail::alignment_of::value; + BOOST_STATIC_CONSTEXPR std::size_t value = boost::move_detail::alignment_of::value; }; } //namespace pmr_dtl diff --git a/include/boost/container/scoped_allocator.hpp b/include/boost/container/scoped_allocator.hpp index a979ad65..90e34062 100644 --- a/include/boost/container/scoped_allocator.hpp +++ b/include/boost/container/scoped_allocator.hpp @@ -56,7 +56,7 @@ struct is_scoped_allocator_imp template static int test(...); - static const bool value = (sizeof(yes_type) == sizeof(test(0))); + BOOST_STATIC_CONSTEXPR bool value = (sizeof(yes_type) == sizeof(test(0))); }; template::value > diff --git a/include/boost/container/set.hpp b/include/boost/container/set.hpp index 1aef8ff0..e71a1ece 100644 --- a/include/boost/container/set.hpp +++ b/include/boost/container/set.hpp @@ -1026,7 +1026,7 @@ template struct has_trivial_destructor_after_move > { typedef ::boost::container::dtl::tree tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { @@ -1681,7 +1681,7 @@ template struct has_trivial_destructor_after_move > { typedef ::boost::container::dtl::tree tree; - static const bool value = ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value; }; namespace container { diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index 0d969275..b8853f56 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -1673,7 +1673,7 @@ struct has_trivial_destructor_after_move > { typedef typename boost::container::slist::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/include/boost/container/small_vector.hpp b/include/boost/container/small_vector.hpp index 41dc15b9..5882326f 100644 --- a/include/boost/container/small_vector.hpp +++ b/include/boost/container/small_vector.hpp @@ -304,13 +304,13 @@ struct small_vector_storage typedef typename dtl::aligned_storage ::type storage_type; 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 struct small_vector_storage { - 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 types that don't depend on the @@ -448,7 +448,7 @@ template struct small_vector_storage_definer { typedef typename dtl::get_small_vector_opt::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::value; typedef small_vector_storage type; }; @@ -557,7 +557,7 @@ class small_vector #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED //! @brief The capacity/max size of the container - static const size_type static_capacity = small_vector_storage_definer::type::sms_size; + BOOST_STATIC_CONSTEXPR size_type static_capacity = small_vector_storage_definer::type::sms_size; public: inline small_vector() @@ -680,7 +680,7 @@ template struct has_trivial_destructor_after_move > { typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/include/boost/container/stable_vector.hpp b/include/boost/container/stable_vector.hpp index b4fbae9e..e0799129 100644 --- a/include/boost/container/stable_vector.hpp +++ b/include/boost/container/stable_vector.hpp @@ -214,7 +214,7 @@ struct index_traits typedef typename index_type::const_iterator const_index_iterator; 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: // back() is this->index.back() - ExtraPointers; // end node index is *(this->index.end() - 3) @@ -598,7 +598,7 @@ class stable_vector #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED private: 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; friend class insert_rollback; @@ -2255,7 +2255,7 @@ struct has_trivial_destructor_after_move::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && ::boost::has_trivial_destructor_after_move::value; }; diff --git a/include/boost/container/static_vector.hpp b/include/boost/container/static_vector.hpp index 3d2badab..1406fdb7 100644 --- a/include/boost/container/static_vector.hpp +++ b/include/boost/container/static_vector.hpp @@ -66,7 +66,7 @@ class static_storage_allocator inline T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW { return move_detail::launder_cast(&storage); } - static const std::size_t internal_capacity = N; + BOOST_STATIC_CONSTEXPR std::size_t internal_capacity = N; std::size_t max_size() const { return N; } @@ -86,7 +86,7 @@ class static_storage_allocator private: 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::value; + BOOST_STATIC_CONSTEXPR std::size_t final_alignment = InplaceAlignment ? InplaceAlignment : dtl::alignment_of::value; typename dtl::aligned_storage::type storage; }; @@ -188,7 +188,7 @@ class static_vector typedef typename base_t::const_reverse_iterator const_reverse_iterator; //! @brief The capacity/max size of the container - static const size_type static_capacity = Capacity; + BOOST_STATIC_CONSTEXPR size_type static_capacity = Capacity; //! @brief Constructs an empty static_vector. //! diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index c78da98b..aec41d6a 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -192,13 +192,13 @@ class basic_string_base ::value>::type long_raw_t; protected: - static const size_type MinInternalBufferChars = 8; - static const size_type AlignmentOfValueType = + BOOST_STATIC_CONSTEXPR size_type MinInternalBufferChars = 8; + BOOST_STATIC_CONSTEXPR size_type AlignmentOfValueType = alignment_of::value; - static const size_type ShortDataOffset = ((sizeof(short_header)-1)/AlignmentOfValueType+1)*AlignmentOfValueType; - static const size_type ZeroCostInternalBufferChars = + BOOST_STATIC_CONSTEXPR size_type ShortDataOffset = ((sizeof(short_header)-1)/AlignmentOfValueType+1)*AlignmentOfValueType; + BOOST_STATIC_CONSTEXPR size_type ZeroCostInternalBufferChars = (sizeof(long_t) - ShortDataOffset)/sizeof(value_type); - static const size_type UnalignedFinalInternalBufferChars = + BOOST_STATIC_CONSTEXPR size_type UnalignedFinalInternalBufferChars = (ZeroCostInternalBufferChars > MinInternalBufferChars) ? ZeroCostInternalBufferChars : MinInternalBufferChars; @@ -261,11 +261,11 @@ class basic_string_base inline allocator_type &alloc() { 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: - static const size_type MinAllocation = InternalBufferChars*2; + BOOST_STATIC_CONSTEXPR size_type MinAllocation = InternalBufferChars*2; protected: inline bool is_short() const @@ -477,7 +477,7 @@ class basic_string_base 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 ); //Make -Wconversion happy this->members_.plong_repr()->length = sz & mask; @@ -566,7 +566,7 @@ class basic_string BOOST_COPYABLE_AND_MOVABLE(basic_string) typedef dtl::basic_string_base::type> base_t; 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: // 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(boost::container::reverse_iterator) reverse_iterator; typedef BOOST_CONTAINER_IMPDEF(boost::container::reverse_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 private: @@ -3092,13 +3092,13 @@ const typename basic_string::size_type template struct is_string { - static const bool value = false; + BOOST_STATIC_CONSTEXPR bool value = false; }; template struct is_string< basic_string > { - static const bool value = true; + BOOST_STATIC_CONSTEXPR bool value = true; }; #endif @@ -3583,8 +3583,9 @@ struct has_trivial_destructor_after_move::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && - ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = + ::boost::has_trivial_destructor_after_move::value && + ::boost::has_trivial_destructor_after_move::value; }; } diff --git a/include/boost/container/uses_allocator.hpp b/include/boost/container/uses_allocator.hpp index e0e35180..11915e64 100644 --- a/include/boost/container/uses_allocator.hpp +++ b/include/boost/container/uses_allocator.hpp @@ -58,7 +58,7 @@ namespace container { //! to detect if a type should be constructed with suffix or prefix allocator arguments. template struct constructible_with_allocator_suffix -{ static const bool value = false; }; +{ BOOST_STATIC_CONSTEXPR bool value = false; }; //! Remark: if a specialization constructible_with_allocator_prefix::value is true, indicates that T may be constructed //! 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. template struct constructible_with_allocator_prefix -{ static const bool value = false; }; +{ BOOST_STATIC_CONSTEXPR bool value = false; }; #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -142,7 +142,7 @@ struct uses_allocator_imp static Allocator alloc; // Declared but not defined public: - static const bool value = sizeof(test(alloc)) == sizeof(yes_type); + BOOST_STATIC_CONSTEXPR bool value = sizeof(test(alloc)) == sizeof(yes_type); }; } //namespace dtl { diff --git a/include/boost/container/vector.hpp b/include/boost/container/vector.hpp index 05122a6b..a84383e1 100644 --- a/include/boost/container/vector.hpp +++ b/include/boost/container/vector.hpp @@ -276,8 +276,8 @@ struct maybe_initial_capacity_t {}; template struct vector_value_traits_base { - static const bool trivial_dctr = dtl::is_trivially_destructible::value; - static const bool trivial_dctr_after_move = has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr = dtl::is_trivially_destructible::value; + BOOST_STATIC_CONSTEXPR bool trivial_dctr_after_move = has_trivial_destructor_after_move::value; }; template @@ -3310,8 +3310,8 @@ struct has_trivial_destructor_after_move::allocator_type allocator_type; typedef typename ::boost::container::allocator_traits::pointer pointer; - static const bool value = ::boost::has_trivial_destructor_after_move::value && - ::boost::has_trivial_destructor_after_move::value; + BOOST_STATIC_CONSTEXPR bool value = ::boost::has_trivial_destructor_after_move::value && + ::boost::has_trivial_destructor_after_move::value; }; }