From 10d027aa9cd76f2898e2446882781d1d37e3318b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 2 Feb 2015 15:26:53 +0100 Subject: [PATCH] Include boost/config.hpp before testinG BOOST_HAS_PRAGMA_ONCE. --- bench/detail/varray.hpp | 4 + bench/varray.hpp | 4 + include/boost/container/adaptive_pool.hpp | 4 + include/boost/container/allocator.hpp | 4 + include/boost/container/allocator_traits.hpp | 4 + include/boost/container/container_fwd.hpp | 4 + include/boost/container/deque.hpp | 4 + .../container/detail/adaptive_node_pool.hpp | 4 + .../detail/adaptive_node_pool_impl.hpp | 4 + include/boost/container/detail/addressof.hpp | 4 + .../container/detail/advanced_insert_int.hpp | 4 + include/boost/container/detail/algorithm.hpp | 4 + .../boost/container/detail/alloc_helpers.hpp | 4 + .../container/detail/alloc_lib_auto_link.hpp | 4 + .../container/detail/allocation_type.hpp | 4 + .../detail/allocator_version_traits.hpp | 4 + include/boost/container/detail/auto_link.hpp | 4 + .../container/detail/compare_functors.hpp | 4 + .../container/detail/construct_in_place.hpp | 4 + .../boost/container/detail/copy_move_algo.hpp | 4 + include/boost/container/detail/destroyers.hpp | 4 + include/boost/container/detail/flat_tree.hpp | 4 + .../container/detail/function_detector.hpp | 4 + include/boost/container/detail/iterator.hpp | 4 + .../detail/iterator_to_raw_pointer.hpp | 4 + include/boost/container/detail/iterators.hpp | 4 + .../boost/container/detail/math_functions.hpp | 4 + include/boost/container/detail/min_max.hpp | 4 + .../detail/minimal_char_traits_header.hpp | 8 +- include/boost/container/detail/mpl.hpp | 4 + .../detail/multiallocation_chain.hpp | 4 + include/boost/container/detail/mutex.hpp | 4 + .../boost/container/detail/next_capacity.hpp | 4 + .../container/detail/node_alloc_holder.hpp | 4 + include/boost/container/detail/node_pool.hpp | 4 + .../boost/container/detail/node_pool_impl.hpp | 4 + include/boost/container/detail/pair.hpp | 4 + .../boost/container/detail/placement_new.hpp | 4 + .../boost/container/detail/pool_common.hpp | 4 + .../container/detail/pool_common_alloc.hpp | 4 + include/boost/container/detail/singleton.hpp | 4 + include/boost/container/detail/std_fwd.hpp | 4 + .../boost/container/detail/to_raw_pointer.hpp | 4 + .../container/detail/transform_iterator.hpp | 4 + include/boost/container/detail/tree.hpp | 4 + .../boost/container/detail/type_traits.hpp | 4 + include/boost/container/detail/value_init.hpp | 4 + .../detail/variadic_templates_tools.hpp | 4 + .../boost/container/detail/version_type.hpp | 4 + include/boost/container/detail/workaround.hpp | 4 + include/boost/container/flat_map.hpp | 4 + include/boost/container/flat_set.hpp | 4 + include/boost/container/list.hpp | 4 + include/boost/container/map.hpp | 4 + include/boost/container/new_allocator.hpp | 4 + include/boost/container/slist.hpp | 4 + include/boost/container/stable_vector.hpp | 4 + include/boost/container/static_vector.hpp | 4 + include/boost/container/string.hpp | 4 + include/boost/container/throw_exception.hpp | 4 + include/boost/container/vector.hpp | 79 ++++++++++++++----- test/dummy_test_allocator.hpp | 4 + test/expand_bwd_test_allocator.hpp | 4 + 63 files changed, 306 insertions(+), 25 deletions(-) diff --git a/bench/detail/varray.hpp b/bench/detail/varray.hpp index ce0cf34..80f76b6 100644 --- a/bench/detail/varray.hpp +++ b/bench/detail/varray.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_VARRAY_HPP #define BOOST_CONTAINER_DETAIL_VARRAY_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/bench/varray.hpp b/bench/varray.hpp index a8e0514..335c33f 100644 --- a/bench/varray.hpp +++ b/bench/varray.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_VARRAY_HPP #define BOOST_CONTAINER_VARRAY_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/adaptive_pool.hpp b/include/boost/container/adaptive_pool.hpp index 7031400..1f6b666 100644 --- a/include/boost/container/adaptive_pool.hpp +++ b/include/boost/container/adaptive_pool.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_ADAPTIVE_POOL_HPP #define BOOST_CONTAINER_ADAPTIVE_POOL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/allocator.hpp b/include/boost/container/allocator.hpp index 334f69a..9f757c7 100644 --- a/include/boost/container/allocator.hpp +++ b/include/boost/container/allocator.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_ALLOCATOR_HPP #define BOOST_CONTAINER_ALLOCATOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/allocator_traits.hpp b/include/boost/container/allocator_traits.hpp index 0ab1041..c1d46c8 100644 --- a/include/boost/container/allocator_traits.hpp +++ b/include/boost/container/allocator_traits.hpp @@ -16,6 +16,10 @@ #ifndef BOOST_CONTAINER_ALLOCATOR_ALLOCATOR_TRAITS_HPP #define BOOST_CONTAINER_ALLOCATOR_ALLOCATOR_TRAITS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/container_fwd.hpp b/include/boost/container/container_fwd.hpp index 0ac6faa..e213172 100644 --- a/include/boost/container/container_fwd.hpp +++ b/include/boost/container/container_fwd.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP #define BOOST_CONTAINER_CONTAINER_FWD_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/deque.hpp b/include/boost/container/deque.hpp index c5a8ce0..b3c5673 100644 --- a/include/boost/container/deque.hpp +++ b/include/boost/container/deque.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DEQUE_HPP #define BOOST_CONTAINER_DEQUE_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/adaptive_node_pool.hpp b/include/boost/container/detail/adaptive_node_pool.hpp index 6285226..4a1f07c 100644 --- a/include/boost/container/detail/adaptive_node_pool.hpp +++ b/include/boost/container/detail/adaptive_node_pool.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_HPP #define BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/adaptive_node_pool_impl.hpp b/include/boost/container/detail/adaptive_node_pool_impl.hpp index 8f7f057..24c81dd 100644 --- a/include/boost/container/detail/adaptive_node_pool_impl.hpp +++ b/include/boost/container/detail/adaptive_node_pool_impl.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP #define BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/addressof.hpp b/include/boost/container/detail/addressof.hpp index a3efa21..cc582c4 100644 --- a/include/boost/container/detail/addressof.hpp +++ b/include/boost/container/detail/addressof.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ADDRESSOF_HPP #define BOOST_CONTAINER_DETAIL_ADDRESSOF_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/advanced_insert_int.hpp b/include/boost/container/detail/advanced_insert_int.hpp index 3baafd2..56df588 100644 --- a/include/boost/container/detail/advanced_insert_int.hpp +++ b/include/boost/container/detail/advanced_insert_int.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_ADVANCED_INSERT_INT_HPP #define BOOST_CONTAINER_ADVANCED_INSERT_INT_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/algorithm.hpp b/include/boost/container/detail/algorithm.hpp index 2d02df5..67e7876 100644 --- a/include/boost/container/detail/algorithm.hpp +++ b/include/boost/container/detail/algorithm.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ALGORITHM_HPP #define BOOST_CONTAINER_DETAIL_ALGORITHM_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/alloc_helpers.hpp b/include/boost/container/detail/alloc_helpers.hpp index ebfe01f..656e0c2 100644 --- a/include/boost/container/detail/alloc_helpers.hpp +++ b/include/boost/container/detail/alloc_helpers.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ALLOC_TRAITS_HPP #define BOOST_CONTAINER_DETAIL_ALLOC_TRAITS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/alloc_lib_auto_link.hpp b/include/boost/container/detail/alloc_lib_auto_link.hpp index e13adfa..aea99a6 100644 --- a/include/boost/container/detail/alloc_lib_auto_link.hpp +++ b/include/boost/container/detail/alloc_lib_auto_link.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_BOOST_CONT_EXT_AUTO_LINK_HPP #define BOOST_CONTAINER_DETAIL_BOOST_CONT_EXT_AUTO_LINK_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/allocation_type.hpp b/include/boost/container/detail/allocation_type.hpp index a7d2989..1e8aa67 100644 --- a/include/boost/container/detail/allocation_type.hpp +++ b/include/boost/container/detail/allocation_type.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_ALLOCATION_TYPE_HPP #define BOOST_CONTAINER_ALLOCATION_TYPE_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/allocator_version_traits.hpp b/include/boost/container/detail/allocator_version_traits.hpp index 731c865..62492da 100644 --- a/include/boost/container/detail/allocator_version_traits.hpp +++ b/include/boost/container/detail/allocator_version_traits.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP #define BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/auto_link.hpp b/include/boost/container/detail/auto_link.hpp index 9e599a3..da078e8 100644 --- a/include/boost/container/detail/auto_link.hpp +++ b/include/boost/container/detail/auto_link.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_AUTO_LINK_HPP_INCLUDED #define BOOST_CONTAINER_DETAIL_AUTO_LINK_HPP_INCLUDED +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/compare_functors.hpp b/include/boost/container/detail/compare_functors.hpp index b8dd7a6..4220d50 100644 --- a/include/boost/container/detail/compare_functors.hpp +++ b/include/boost/container/detail/compare_functors.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_COMPARE_FUNCTORS_HPP #define BOOST_CONTAINER_DETAIL_COMPARE_FUNCTORS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/construct_in_place.hpp b/include/boost/container/detail/construct_in_place.hpp index e56291f..6cb3395 100644 --- a/include/boost/container/detail/construct_in_place.hpp +++ b/include/boost/container/detail/construct_in_place.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_DETAIL_CONSTRUCT_IN_PLACE_HPP #define BOOST_CONTAINER_DETAIL_CONSTRUCT_IN_PLACE_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/copy_move_algo.hpp b/include/boost/container/detail/copy_move_algo.hpp index 24459f7..1b4e342 100644 --- a/include/boost/container/detail/copy_move_algo.hpp +++ b/include/boost/container/detail/copy_move_algo.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_UTILITIES_HPP #define BOOST_CONTAINER_DETAIL_UTILITIES_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/destroyers.hpp b/include/boost/container/detail/destroyers.hpp index 27ecf8a..dc25c6d 100644 --- a/include/boost/container/detail/destroyers.hpp +++ b/include/boost/container/detail/destroyers.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_DESTROYERS_HPP #define BOOST_CONTAINER_DESTROYERS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index e74a801..714d087 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_FLAT_TREE_HPP #define BOOST_CONTAINER_FLAT_TREE_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/function_detector.hpp b/include/boost/container/detail/function_detector.hpp index d656f4a..00caced 100644 --- a/include/boost/container/detail/function_detector.hpp +++ b/include/boost/container/detail/function_detector.hpp @@ -22,6 +22,10 @@ #ifndef BOOST_CONTAINER_DETAIL_FUNCTION_DETECTOR_HPP #define BOOST_CONTAINER_DETAIL_FUNCTION_DETECTOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/iterator.hpp b/include/boost/container/detail/iterator.hpp index 918e2e9..ceb224f 100644 --- a/include/boost/container/detail/iterator.hpp +++ b/include/boost/container/detail/iterator.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ITERATOR_HPP #define BOOST_CONTAINER_DETAIL_ITERATOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/iterator_to_raw_pointer.hpp b/include/boost/container/detail/iterator_to_raw_pointer.hpp index 44ab9ec..83736d8 100644 --- a/include/boost/container/detail/iterator_to_raw_pointer.hpp +++ b/include/boost/container/detail/iterator_to_raw_pointer.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ITERATOR_TO_RAW_POINTER_HPP #define BOOST_CONTAINER_DETAIL_ITERATOR_TO_RAW_POINTER_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/iterators.hpp b/include/boost/container/detail/iterators.hpp index d99d214..1f80d3e 100644 --- a/include/boost/container/detail/iterators.hpp +++ b/include/boost/container/detail/iterators.hpp @@ -14,6 +14,10 @@ #ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP #define BOOST_CONTAINER_DETAIL_ITERATORS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/math_functions.hpp b/include/boost/container/detail/math_functions.hpp index c5d171b..e499f63 100644 --- a/include/boost/container/detail/math_functions.hpp +++ b/include/boost/container/detail/math_functions.hpp @@ -16,6 +16,10 @@ #ifndef BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP #define BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/min_max.hpp b/include/boost/container/detail/min_max.hpp index 646f324..7486db7 100644 --- a/include/boost/container/detail/min_max.hpp +++ b/include/boost/container/detail/min_max.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_MIN_MAX_HPP #define BOOST_CONTAINER_DETAIL_MIN_MAX_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/minimal_char_traits_header.hpp b/include/boost/container/detail/minimal_char_traits_header.hpp index 74cd801..a92a31a 100644 --- a/include/boost/container/detail/minimal_char_traits_header.hpp +++ b/include/boost/container/detail/minimal_char_traits_header.hpp @@ -12,14 +12,14 @@ #ifndef BOOST_CONTAINER_DETAIL_MINIMAL_CHAR_TRAITS_HEADER_HPP #define BOOST_CONTAINER_DETAIL_MINIMAL_CHAR_TRAITS_HEADER_HPP # -#if defined(BOOST_HAS_PRAGMA_ONCE) -# pragma once -#endif -# #ifndef BOOST_CONFIG_HPP # include #endif # +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif +# #//Try to avoid including , as it's quite big #if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB) #include //Dinkum libraries for MSVC define std::char_traits there diff --git a/include/boost/container/detail/mpl.hpp b/include/boost/container/detail/mpl.hpp index 90dc354..74b618f 100644 --- a/include/boost/container/detail/mpl.hpp +++ b/include/boost/container/detail/mpl.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP #define BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/multiallocation_chain.hpp b/include/boost/container/detail/multiallocation_chain.hpp index a539ff9..32f87c8 100644 --- a/include/boost/container/detail/multiallocation_chain.hpp +++ b/include/boost/container/detail/multiallocation_chain.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP #define BOOST_CONTAINER_DETAIL_MULTIALLOCATION_CHAIN_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/mutex.hpp b/include/boost/container/detail/mutex.hpp index b7cd60a..f8efa7f 100644 --- a/include/boost/container/detail/mutex.hpp +++ b/include/boost/container/detail/mutex.hpp @@ -19,6 +19,10 @@ #ifndef BOOST_CONTAINER_MUTEX_HPP #define BOOST_CONTAINER_MUTEX_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/next_capacity.hpp b/include/boost/container/detail/next_capacity.hpp index ae5e27b..3bc98a3 100644 --- a/include/boost/container/detail/next_capacity.hpp +++ b/include/boost/container/detail/next_capacity.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_NEXT_CAPACITY_HPP #define BOOST_CONTAINER_DETAIL_NEXT_CAPACITY_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/node_alloc_holder.hpp b/include/boost/container/detail/node_alloc_holder.hpp index e84bd96..9cf3cd0 100644 --- a/include/boost/container/detail/node_alloc_holder.hpp +++ b/include/boost/container/detail/node_alloc_holder.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_NODE_ALLOC_HPP_ #define BOOST_CONTAINER_DETAIL_NODE_ALLOC_HPP_ +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/node_pool.hpp b/include/boost/container/detail/node_pool.hpp index 927c83a..00e35df 100644 --- a/include/boost/container/detail/node_pool.hpp +++ b/include/boost/container/detail/node_pool.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_NODE_POOL_HPP #define BOOST_CONTAINER_DETAIL_NODE_POOL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/node_pool_impl.hpp b/include/boost/container/detail/node_pool_impl.hpp index 7dd46b9..4febf19 100644 --- a/include/boost/container/detail/node_pool_impl.hpp +++ b/include/boost/container/detail/node_pool_impl.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_NODE_POOL_IMPL_HPP #define BOOST_CONTAINER_DETAIL_NODE_POOL_IMPL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/pair.hpp b/include/boost/container/detail/pair.hpp index 9f7ecd3..051b2fe 100644 --- a/include/boost/container/detail/pair.hpp +++ b/include/boost/container/detail/pair.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP #define BOOST_CONTAINER_CONTAINER_DETAIL_PAIR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/placement_new.hpp b/include/boost/container/detail/placement_new.hpp index e6e40d7..c50981f 100644 --- a/include/boost/container/detail/placement_new.hpp +++ b/include/boost/container/detail/placement_new.hpp @@ -10,6 +10,10 @@ // /////////////////////////////////////////////////////////////////////////////// +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/pool_common.hpp b/include/boost/container/detail/pool_common.hpp index 4619f4b..61d0612 100644 --- a/include/boost/container/detail/pool_common.hpp +++ b/include/boost/container/detail/pool_common.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_POOL_COMMON_HPP #define BOOST_CONTAINER_DETAIL_POOL_COMMON_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/pool_common_alloc.hpp b/include/boost/container/detail/pool_common_alloc.hpp index 10cc59b..72e9c8d 100644 --- a/include/boost/container/detail/pool_common_alloc.hpp +++ b/include/boost/container/detail/pool_common_alloc.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_POOL_COMMON_ALLOC_HPP #define BOOST_CONTAINER_DETAIL_POOL_COMMON_ALLOC_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/singleton.hpp b/include/boost/container/detail/singleton.hpp index 45533a2..6fd6a54 100644 --- a/include/boost/container/detail/singleton.hpp +++ b/include/boost/container/detail/singleton.hpp @@ -22,6 +22,10 @@ #ifndef BOOST_CONTAINER_DETAIL_SINGLETON_DETAIL_HPP #define BOOST_CONTAINER_DETAIL_SINGLETON_DETAIL_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/std_fwd.hpp b/include/boost/container/detail/std_fwd.hpp index 8a22f68..55a2175 100644 --- a/include/boost/container/detail/std_fwd.hpp +++ b/include/boost/container/detail/std_fwd.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP #define BOOST_CONTAINER_DETAIL_STD_FWD_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/to_raw_pointer.hpp b/include/boost/container/detail/to_raw_pointer.hpp index d196e55..0b4445a 100644 --- a/include/boost/container/detail/to_raw_pointer.hpp +++ b/include/boost/container/detail/to_raw_pointer.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_DETAIL_TO_RAW_POINTER_HPP #define BOOST_CONTAINER_DETAIL_TO_RAW_POINTER_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/transform_iterator.hpp b/include/boost/container/detail/transform_iterator.hpp index c56b166..ba64c7d 100644 --- a/include/boost/container/detail/transform_iterator.hpp +++ b/include/boost/container/detail/transform_iterator.hpp @@ -14,6 +14,10 @@ #ifndef BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP #define BOOST_CONTAINER_DETAIL_TRANSFORM_ITERATORS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/tree.hpp b/include/boost/container/detail/tree.hpp index 587e130..e64c5aa 100644 --- a/include/boost/container/detail/tree.hpp +++ b/include/boost/container/detail/tree.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_TREE_HPP #define BOOST_CONTAINER_TREE_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/type_traits.hpp b/include/boost/container/detail/type_traits.hpp index 55cccd2..1ae2426 100644 --- a/include/boost/container/detail/type_traits.hpp +++ b/include/boost/container/detail/type_traits.hpp @@ -16,6 +16,10 @@ #ifndef BOOST_CONTAINER_CONTAINER_DETAIL_TYPE_TRAITS_HPP #define BOOST_CONTAINER_CONTAINER_DETAIL_TYPE_TRAITS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/value_init.hpp b/include/boost/container/detail/value_init.hpp index 521bbb8..eb4c976 100644 --- a/include/boost/container/detail/value_init.hpp +++ b/include/boost/container/detail/value_init.hpp @@ -13,6 +13,10 @@ #ifndef BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP #define BOOST_CONTAINER_DETAIL_VALUE_INIT_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/variadic_templates_tools.hpp b/include/boost/container/detail/variadic_templates_tools.hpp index 20e982e..ec8b8ce 100644 --- a/include/boost/container/detail/variadic_templates_tools.hpp +++ b/include/boost/container/detail/variadic_templates_tools.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP #define BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/version_type.hpp b/include/boost/container/detail/version_type.hpp index 95a4181..a20b3ee 100644 --- a/include/boost/container/detail/version_type.hpp +++ b/include/boost/container/detail/version_type.hpp @@ -16,6 +16,10 @@ #ifndef BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP #define BOOST_CONTAINER_DETAIL_VERSION_TYPE_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/detail/workaround.hpp b/include/boost/container/detail/workaround.hpp index 54b2ac9..ecdaa9d 100644 --- a/include/boost/container/detail/workaround.hpp +++ b/include/boost/container/detail/workaround.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP #define BOOST_CONTAINER_DETAIL_WORKAROUND_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index db39f57..b717f1a 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_FLAT_MAP_HPP #define BOOST_CONTAINER_FLAT_MAP_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/flat_set.hpp b/include/boost/container/flat_set.hpp index 16bdc2b..13a2fab 100644 --- a/include/boost/container/flat_set.hpp +++ b/include/boost/container/flat_set.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_FLAT_SET_HPP #define BOOST_CONTAINER_FLAT_SET_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/list.hpp b/include/boost/container/list.hpp index d174746..d9bd939 100644 --- a/include/boost/container/list.hpp +++ b/include/boost/container/list.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_LIST_HPP #define BOOST_CONTAINER_LIST_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/map.hpp b/include/boost/container/map.hpp index d0be8b7..6d757c7 100644 --- a/include/boost/container/map.hpp +++ b/include/boost/container/map.hpp @@ -10,6 +10,10 @@ #ifndef BOOST_CONTAINER_MAP_HPP #define BOOST_CONTAINER_MAP_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/new_allocator.hpp b/include/boost/container/new_allocator.hpp index f257e64..1ac15d8 100644 --- a/include/boost/container/new_allocator.hpp +++ b/include/boost/container/new_allocator.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_NEW_ALLOCATOR_HPP #define BOOST_CONTAINER_NEW_ALLOCATOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index 161ad0b..1867171 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_SLIST_HPP #define BOOST_CONTAINER_SLIST_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/stable_vector.hpp b/include/boost/container/stable_vector.hpp index 39121f7..07a0ed5 100644 --- a/include/boost/container/stable_vector.hpp +++ b/include/boost/container/stable_vector.hpp @@ -19,6 +19,10 @@ #ifndef BOOST_CONTAINER_STABLE_VECTOR_HPP #define BOOST_CONTAINER_STABLE_VECTOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/static_vector.hpp b/include/boost/container/static_vector.hpp index 1446767..c36832d 100644 --- a/include/boost/container/static_vector.hpp +++ b/include/boost/container/static_vector.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_STATIC_VECTOR_HPP #define BOOST_CONTAINER_STATIC_VECTOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index c5107cf..e5ec287 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_STRING_HPP #define BOOST_CONTAINER_STRING_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/throw_exception.hpp b/include/boost/container/throw_exception.hpp index 36a1869..2c893e9 100644 --- a/include/boost/container/throw_exception.hpp +++ b/include/boost/container/throw_exception.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_THROW_EXCEPTION_HPP #define BOOST_CONTAINER_THROW_EXCEPTION_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/include/boost/container/vector.hpp b/include/boost/container/vector.hpp index 6a9d89a..5859d16 100644 --- a/include/boost/container/vector.hpp +++ b/include/boost/container/vector.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_CONTAINER_VECTOR_HPP #define BOOST_CONTAINER_CONTAINER_VECTOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif @@ -592,14 +596,14 @@ class vector ////////////////////////////////////////////// typedef T value_type; - typedef typename ::boost::container::allocator_traits::pointer pointer; - typedef typename ::boost::container::allocator_traits::const_pointer const_pointer; - typedef typename ::boost::container::allocator_traits::reference reference; - typedef typename ::boost::container::allocator_traits::const_reference const_reference; - typedef typename ::boost::container::allocator_traits::size_type size_type; - typedef typename ::boost::container::allocator_traits::difference_type difference_type; - typedef Allocator allocator_type; - typedef Allocator stored_allocator_type; + typedef typename ::boost::container::allocator_traits::pointer pointer; + typedef typename ::boost::container::allocator_traits::const_pointer const_pointer; + typedef typename ::boost::container::allocator_traits::reference reference; + typedef typename ::boost::container::allocator_traits::const_reference const_reference; + typedef typename ::boost::container::allocator_traits::size_type size_type; + typedef typename ::boost::container::allocator_traits::difference_type difference_type; + typedef Allocator allocator_type; + typedef Allocator stored_allocator_type; #if defined BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER typedef BOOST_CONTAINER_IMPDEF(pointer) iterator; typedef BOOST_CONTAINER_IMPDEF(const_pointer) const_iterator; @@ -626,11 +630,10 @@ class vector //! Effects: Constructs a vector taking the allocator as parameter. //! - //! Throws: If allocator_type's default constructor throws. + //! Throws: Nothing. //! //! Complexity: Constant. - vector() - BOOST_NOEXCEPT_IF(container_detail::is_nothrow_default_constructible::value) + vector() BOOST_NOEXCEPT_OR_NOTHROW : m_holder() {} @@ -643,10 +646,9 @@ class vector : m_holder(a) {} - //! Effects: Constructs a vector that will use a copy of allocator a - //! and inserts n value initialized values. + //! Effects: Constructs a vector and inserts n value initialized values. //! - //! Throws: If allocator_type's default constructor or allocation + //! Throws: If allocator_type's allocation //! throws or T's value initialization throws. //! //! Complexity: Linear to n. @@ -663,7 +665,7 @@ class vector //! Effects: Constructs a vector that will use a copy of allocator a //! and inserts n default initialized values. //! - //! Throws: If allocator_type's default constructor or allocation + //! Throws: If allocator_type's allocation //! throws or T's default initialization throws. //! //! Complexity: Linear to n. @@ -679,10 +681,46 @@ class vector (this->m_holder.alloc(), n, container_detail::to_raw_pointer(this->m_holder.start())); } + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts n value initialized values. + //! + //! Throws: If allocator_type's allocation + //! throws or T's value initialization throws. + //! + //! Complexity: Linear to n. + explicit vector(size_type n, const allocator_type &a) + : m_holder(container_detail::uninitialized_size, a, n) + { + #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += n != 0; + #endif + boost::container::uninitialized_value_init_alloc_n + (this->m_holder.alloc(), n, container_detail::to_raw_pointer(this->m_holder.start())); + } + + //! Effects: Constructs a vector that will use a copy of allocator a + //! and inserts n default initialized values. + //! + //! Throws: If allocator_type's allocation + //! throws or T's default initialization throws. + //! + //! Complexity: Linear to n. + //! + //! Note: Non-standard extension + vector(size_type n, default_init_t, const allocator_type &a) + : m_holder(container_detail::uninitialized_size, a, n) + { + #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS + this->num_alloc += n != 0; + #endif + boost::container::uninitialized_default_init_alloc_n + (this->m_holder.alloc(), n, container_detail::to_raw_pointer(this->m_holder.start())); + } + //! Effects: Constructs a vector //! and inserts n copies of value. //! - //! Throws: If allocator_type's default constructor or allocation + //! Throws: If allocator_type's allocation //! throws or T's copy constructor throws. //! //! Complexity: Linear to n. @@ -716,7 +754,7 @@ class vector //! Effects: Constructs a vector //! and inserts a copy of the range [first, last) in the vector. //! - //! Throws: If allocator_type's default constructor or allocation + //! Throws: If allocator_type's allocation //! throws or T's constructor taking a dereferenced InIt throws. //! //! Complexity: Linear to the range [first, last). @@ -728,7 +766,7 @@ class vector //! Effects: Constructs a vector that will use a copy of allocator a //! and inserts a copy of the range [first, last) in the vector. //! - //! Throws: If allocator_type's default constructor or allocation + //! Throws: If allocator_type's allocation //! throws or T's constructor taking a dereferenced InIt throws. //! //! Complexity: Linear to the range [first, last). @@ -741,7 +779,7 @@ class vector //! //! Postcondition: x == *this. //! - //! Throws: If allocator_type's default constructor or allocation + //! Throws: If allocator_type's allocation //! throws or T's copy constructor throws. //! //! Complexity: Linear to the elements x contains. @@ -762,8 +800,7 @@ class vector //! Effects: Constructs a vector that will use a copy of allocator a //! and inserts a copy of the range [il.begin(), il.last()) in the vector //! - //! Throws: If allocator_type's default constructor - //! throws or T's constructor taking a dereferenced initializer_list iterator throws. + //! Throws: If T's constructor taking a dereferenced initializer_list iterator throws. //! //! Complexity: Linear to the range [il.begin(), il.end()). vector(std::initializer_list il, const allocator_type& a = allocator_type()) diff --git a/test/dummy_test_allocator.hpp b/test/dummy_test_allocator.hpp index 5aafd18..538bf7e 100644 --- a/test/dummy_test_allocator.hpp +++ b/test/dummy_test_allocator.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP #define BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif diff --git a/test/expand_bwd_test_allocator.hpp b/test/expand_bwd_test_allocator.hpp index 887dea9..2e16093 100644 --- a/test/expand_bwd_test_allocator.hpp +++ b/test/expand_bwd_test_allocator.hpp @@ -11,6 +11,10 @@ #ifndef BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP #define BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP +#ifndef BOOST_CONFIG_HPP +# include +#endif + #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif