summaryrefslogtreecommitdiff
path: root/libs/container
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-04-08 03:09:47 +0000
committer <>2015-05-05 14:37:32 +0000
commitf2541bb90af059680aa7036f315f052175999355 (patch)
treea5b214744b256f07e1dc2bd7273035a7808c659f /libs/container
parented232fdd34968697a68783b3195b1da4226915b5 (diff)
downloadboost-tarball-master.tar.gz
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/container')
-rw-r--r--libs/container/bench/bench_alloc_expand_fwd.cpp24
-rw-r--r--libs/container/bench/bench_set.hpp51
-rw-r--r--libs/container/bench/bench_set_alloc_v2.cpp6
-rw-r--r--libs/container/bench/detail/varray.hpp281
-rw-r--r--libs/container/bench/detail/varray_concept.hpp4
-rw-r--r--libs/container/bench/detail/varray_util.hpp419
-rw-r--r--libs/container/bench/varray.hpp6
-rw-r--r--libs/container/doc/Jamfile.v213
-rw-r--r--libs/container/doc/container.qbk57
-rw-r--r--libs/container/proj/vc7ide/alloc_lib.vcproj91
-rw-r--r--libs/container/proj/vc7ide/allocator_traits_test.vcproj262
-rw-r--r--libs/container/proj/vc7ide/container.sln96
-rw-r--r--libs/container/proj/vc7ide/container.vcproj61
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_deque_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_flat_map_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_flat_set_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_list_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_map_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_set_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_slist_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_stable_vector_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_static_vector_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_string_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/explicit_inst_vector_test.vcproj136
-rw-r--r--libs/container/proj/vc7ide/list_test.vcproj1
-rw-r--r--libs/container/proj/vc7ide/scoped_allocator_adaptor.vcproj262
-rw-r--r--libs/container/proj/vc7ide/small_vector_test.vcproj135
-rw-r--r--libs/container/proj/vc7ide/throw_exception_test.vcproj264
-rw-r--r--libs/container/test/alloc_full_test.cpp1
-rw-r--r--libs/container/test/allocator_traits_test.cpp227
-rw-r--r--libs/container/test/check_equal_containers.hpp31
-rw-r--r--libs/container/test/container_common_tests.hpp86
-rw-r--r--libs/container/test/default_init_test.hpp33
-rw-r--r--libs/container/test/deque_test.cpp55
-rw-r--r--libs/container/test/dummy_test_allocator.hpp51
-rw-r--r--libs/container/test/emplace_test.hpp5
-rw-r--r--libs/container/test/expand_bwd_test_allocator.hpp41
-rw-r--r--libs/container/test/expand_bwd_test_template.hpp21
-rw-r--r--libs/container/test/explicit_inst_deque_test.cpp26
-rw-r--r--libs/container/test/explicit_inst_flat_map_test.cpp28
-rw-r--r--libs/container/test/explicit_inst_flat_set_test.cpp28
-rw-r--r--libs/container/test/explicit_inst_list_test.cpp26
-rw-r--r--libs/container/test/explicit_inst_map_test.cpp28
-rw-r--r--libs/container/test/explicit_inst_set_test.cpp28
-rw-r--r--libs/container/test/explicit_inst_slist_test.cpp26
-rw-r--r--libs/container/test/explicit_inst_stable_vector_test.cpp26
-rw-r--r--libs/container/test/explicit_inst_static_vector_test.cpp26
-rw-r--r--libs/container/test/explicit_inst_string_test.cpp20
-rw-r--r--libs/container/test/explicit_inst_vector_test.cpp26
-rw-r--r--libs/container/test/flat_map_test.cpp147
-rw-r--r--libs/container/test/flat_set_test.cpp92
-rw-r--r--libs/container/test/input_from_forward_iterator.hpp16
-rw-r--r--libs/container/test/insert_test.hpp3
-rw-r--r--libs/container/test/insert_vs_emplace_test.cpp8
-rw-r--r--libs/container/test/list_test.cpp40
-rw-r--r--libs/container/test/list_test.hpp134
-rw-r--r--libs/container/test/map_test.cpp114
-rw-r--r--libs/container/test/map_test.hpp159
-rw-r--r--libs/container/test/null_iterators_test.cpp5
-rw-r--r--libs/container/test/print_container.hpp21
-rw-r--r--libs/container/test/propagate_allocator_test.hpp435
-rw-r--r--libs/container/test/scoped_allocator_adaptor_test.cpp148
-rw-r--r--libs/container/test/scoped_allocator_usage_test.cpp201
-rw-r--r--libs/container/test/set_test.cpp98
-rw-r--r--libs/container/test/set_test.hpp130
-rw-r--r--libs/container/test/slist_test.cpp29
-rw-r--r--libs/container/test/small_vector_test.cpp183
-rw-r--r--libs/container/test/stable_vector_test.cpp30
-rw-r--r--libs/container/test/static_vector_test.cpp10
-rw-r--r--libs/container/test/static_vector_test.hpp3
-rw-r--r--libs/container/test/string_test.cpp43
-rw-r--r--libs/container/test/vector_test.cpp20
-rw-r--r--libs/container/test/vector_test.hpp96
73 files changed, 4746 insertions, 1787 deletions
diff --git a/libs/container/bench/bench_alloc_expand_fwd.cpp b/libs/container/bench/bench_alloc_expand_fwd.cpp
index 1f88da4d2..b3108bcb1 100644
--- a/libs/container/bench/bench_alloc_expand_fwd.cpp
+++ b/libs/container/bench/bench_alloc_expand_fwd.cpp
@@ -60,32 +60,32 @@ struct stats_traits;
template<>
struct stats_traits<std::vector>
{
- template<class T, class A>
- static void reset_alloc_stats(std::vector<T, A> &)
+ template<class T, class Allocator>
+ static void reset_alloc_stats(std::vector<T, Allocator> &)
{}
- template<class T, class A>
- static std::size_t get_num_alloc(std::vector<T, A> &)
+ template<class T, class Allocator>
+ static std::size_t get_num_alloc(std::vector<T, Allocator> &)
{ return 0; }
- template<class T, class A>
- static std::size_t get_num_expand(std::vector<T, A> &)
+ template<class T, class Allocator>
+ static std::size_t get_num_expand(std::vector<T, Allocator> &)
{ return 0; }
};
template<>
struct stats_traits<bc::vector>
{
- template<class T, class A>
- static void reset_alloc_stats(bc::vector<T, A> &v)
+ template<class T, class Allocator>
+ static void reset_alloc_stats(bc::vector<T, Allocator> &v)
{ v.reset_alloc_stats(); }
- template<class T, class A>
- static std::size_t get_num_alloc(bc::vector<T, A> &v)
+ template<class T, class Allocator>
+ static std::size_t get_num_alloc(bc::vector<T, Allocator> &v)
{ return v.num_alloc; }
- template<class T, class A>
- static std::size_t get_num_expand(bc::vector<T, A> &v)
+ template<class T, class Allocator>
+ static std::size_t get_num_expand(bc::vector<T, Allocator> &v)
{ return v.num_expand_fwd; }
};
diff --git a/libs/container/bench/bench_set.hpp b/libs/container/bench/bench_set.hpp
index cdc304395..b94c5a459 100644
--- a/libs/container/bench/bench_set.hpp
+++ b/libs/container/bench/bench_set.hpp
@@ -13,7 +13,7 @@
#include <iostream>
#include <boost/timer/timer.hpp>
-#include <algorithm>
+#include <algorithm> //sort
#include <exception>
#include <sstream>
#include <iomanip>
@@ -23,7 +23,6 @@
using boost::timer::cpu_timer;
using boost::timer::cpu_times;
using boost::timer::nanosecond_type;
-using namespace boost::container;
#ifdef NDEBUG
static const std::size_t NElements = 1000;
@@ -42,10 +41,10 @@ void compare_times(cpu_times time_numerator, cpu_times time_denominator){
std::cout << "----------------------------------------------" << '\n' << std::endl;
}
-vector<int> sorted_unique_range_int;
-vector<int> sorted_range_int;
-vector<int> random_unique_range_int;
-vector<int> random_range_int;
+boost::container::vector<int> sorted_unique_range_int;
+boost::container::vector<int> sorted_range_int;
+boost::container::vector<int> random_unique_range_int;
+boost::container::vector<int> random_range_int;
void fill_range_ints()
{
@@ -69,15 +68,15 @@ void fill_range_ints()
std::random_shuffle(random_unique_range_int.begin(), random_unique_range_int.end());
}
-vector<string> sorted_unique_range_string;
-vector<string> sorted_range_string;
-vector<string> random_unique_range_string;
-vector<string> random_range_string;
+boost::container::vector<boost::container::string> sorted_unique_range_string;
+boost::container::vector<boost::container::string> sorted_range_string;
+boost::container::vector<boost::container::string> random_unique_range_string;
+boost::container::vector<boost::container::string> random_range_string;
void fill_range_strings()
{
- string model_s;
- model_s.append(sizeof(string), '*');
+ boost::container::string model_s;
+ model_s.append(sizeof(boost::container::string), '*');
//sorted_unique_range_int
sorted_unique_range_string.resize(NElements);
@@ -111,7 +110,7 @@ struct range_provider;
template<>
struct range_provider<int>
{
- typedef vector<int> type;
+ typedef boost::container::vector<int> type;
static type &sorted_unique()
{ return sorted_unique_range_int; }
@@ -127,9 +126,9 @@ struct range_provider<int>
};
template<>
-struct range_provider<string>
+struct range_provider<boost::container::string>
{
- typedef vector<string> type;
+ typedef boost::container::vector<boost::container::string> type;
static type &sorted_unique()
{ return sorted_unique_range_string; }
@@ -145,7 +144,7 @@ struct range_provider<string>
};
template<typename C>
-cpu_times copy_destroy_time(vector<typename C::value_type> &unique_range)
+cpu_times copy_destroy_time(boost::container::vector<typename C::value_type> &unique_range)
{
cpu_timer copy_timer, assign_timer, destroy_timer;
@@ -176,7 +175,9 @@ cpu_times copy_destroy_time(vector<typename C::value_type> &unique_range)
}
template<typename C>
-cpu_times construct_time(vector<typename C::value_type> &unique_range, vector<typename C::value_type> &range, const char *RangeType)
+cpu_times construct_time( boost::container::vector<typename C::value_type> &unique_range
+ , boost::container::vector<typename C::value_type> &range
+ , const char *RangeType)
{
cpu_timer sur_timer, sr_timer;
@@ -206,7 +207,9 @@ cpu_times construct_time(vector<typename C::value_type> &unique_range, vector<ty
}
template<typename C>
-cpu_times insert_time(vector<typename C::value_type> &unique_range, vector<typename C::value_type> &range, const char *RangeType)
+cpu_times insert_time( boost::container::vector<typename C::value_type> &unique_range
+ , boost::container::vector<typename C::value_type> &range
+ , const char *RangeType)
{
cpu_timer ur_timer,r_timer;
ur_timer.stop();r_timer.stop();
@@ -240,7 +243,7 @@ cpu_times insert_time(vector<typename C::value_type> &unique_range, vector<typen
}
template<typename Iterator>
-bool check_not_end(vector<Iterator> &iterators, Iterator itend, std::size_t number_of_ends = 0)
+bool check_not_end(boost::container::vector<Iterator> &iterators, Iterator itend, std::size_t number_of_ends = 0)
{
std::size_t end_count = 0;
for(std::size_t i = 0, max = iterators.size(); i != max; ++i){
@@ -251,7 +254,7 @@ bool check_not_end(vector<Iterator> &iterators, Iterator itend, std::size_t numb
}
template<typename Iterator>
-bool check_all_not_empty(vector< std::pair<Iterator, Iterator > > &iterator_pairs)
+bool check_all_not_empty(boost::container::vector< std::pair<Iterator, Iterator > > &iterator_pairs)
{
for(std::size_t i = 0, max = iterator_pairs.size(); i != max; ++i){
if(iterator_pairs[i].first == iterator_pairs[i].second)
@@ -261,7 +264,7 @@ bool check_all_not_empty(vector< std::pair<Iterator, Iterator > > &iterator_pair
}
template<typename C>
-cpu_times search_time(vector<typename C::value_type> &unique_range, const char *RangeType)
+cpu_times search_time(boost::container::vector<typename C::value_type> &unique_range, const char *RangeType)
{
cpu_timer find_timer, lower_timer, upper_timer, equal_range_timer, count_timer;
@@ -270,8 +273,8 @@ cpu_times search_time(vector<typename C::value_type> &unique_range, const char *
cpu_timer total_time;
total_time.resume();
- vector<typename C::iterator> v_it(NElements);
- vector< std::pair<typename C::iterator, typename C::iterator> > v_itp(NElements);
+ boost::container::vector<typename C::iterator> v_it(NElements);
+ boost::container::vector< std::pair<typename C::iterator, typename C::iterator> > v_itp(NElements);
for(std::size_t i = 0; i != NIter; ++i){
//Find
@@ -348,7 +351,7 @@ cpu_times search_time(vector<typename C::value_type> &unique_range, const char *
}
template<typename C>
-void extensions_time(vector<typename C::value_type> &sorted_unique_range)
+void extensions_time(boost::container::vector<typename C::value_type> &sorted_unique_range)
{
cpu_timer sur_timer,sur_opt_timer;
sur_timer.stop();sur_opt_timer.stop();
diff --git a/libs/container/bench/bench_set_alloc_v2.cpp b/libs/container/bench/bench_set_alloc_v2.cpp
index b92759058..9c2fb9bee 100644
--- a/libs/container/bench/bench_set_alloc_v2.cpp
+++ b/libs/container/bench/bench_set_alloc_v2.cpp
@@ -8,9 +8,9 @@
//
//////////////////////////////////////////////////////////////////////////////
-#include "boost/container/set.hpp"
-#include "boost/container/allocator.hpp"
#include "bench_set.hpp"
+#include <boost/container/set.hpp>
+#include <boost/container/allocator.hpp>
int main()
{
@@ -19,7 +19,7 @@ int main()
fill_range_ints();
fill_range_strings();
- //set<..., allocator_v2> vs. set
+ //set<..., version_2> vs. set
launch_tests< set<int, std::less<int>, allocator<int> >, set<int> >
("set<int, ..., allocator<int>", "set<int>");
launch_tests< set<string, std::less<string>, allocator<string> >, set<string> >
diff --git a/libs/container/bench/detail/varray.hpp b/libs/container/bench/detail/varray.hpp
index 244c34d55..80f76b642 100644
--- a/libs/container/bench/detail/varray.hpp
+++ b/libs/container/bench/detail/varray.hpp
@@ -11,32 +11,39 @@
#ifndef BOOST_CONTAINER_DETAIL_VARRAY_HPP
#define BOOST_CONTAINER_DETAIL_VARRAY_HPP
-#if defined(_MSC_VER)
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/detail/preprocessor.hpp>
+#include <boost/container/detail/addressof.hpp>
+#include <boost/container/detail/algorithm.hpp> //algo_equal(), algo_lexicographical_compare
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+#include <boost/move/detail/fwd_macros.hpp>
+#endif
+#include <boost/container/detail/iterator.hpp>
#include <boost/container/detail/iterators.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <boost/move/adl_move_swap.hpp> //adl_move_swap
-#include "varray_util.hpp"
-#ifndef BOOST_NO_EXCEPTIONS
-#include <stdexcept>
-#endif // BOOST_NO_EXCEPTIONS
+#include "varray_util.hpp"
#include <boost/assert.hpp>
#include <boost/config.hpp>
-#include <boost/swap.hpp>
-#include <boost/integer.hpp>
-#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_unsigned.hpp>
-#include <boost/type_traits/alignment_of.hpp>
-#include <boost/type_traits/aligned_storage.hpp>
+#ifndef BOOST_NO_EXCEPTIONS
+#include <stdexcept>
+#endif // BOOST_NO_EXCEPTIONS
/**
@@ -174,9 +181,9 @@ struct varray_traits
typedef varray_error_handler error_handler;
- typedef boost::false_type use_memop_in_swap_and_move;
- typedef boost::false_type use_optimized_swap;
- typedef boost::false_type disable_trivial_init;
+ typedef false_type use_memop_in_swap_and_move;
+ typedef false_type use_optimized_swap;
+ typedef false_type disable_trivial_init;
};
/**
@@ -218,18 +225,10 @@ class varray
> vt;
typedef typename vt::error_handler errh;
-
- BOOST_MPL_ASSERT_MSG(
- ( boost::is_unsigned<typename vt::size_type>::value &&
- sizeof(typename boost::uint_value_t<Capacity>::least) <= sizeof(typename vt::size_type) ),
- SIZE_TYPE_IS_TOO_SMALL_FOR_SPECIFIED_CAPACITY,
- (varray)
- );
-
- typedef boost::aligned_storage<
+ typedef typename aligned_storage<
sizeof(Value[Capacity]),
- boost::alignment_of<Value[Capacity]>::value
- > aligned_storage_type;
+ boost::container::container_detail::alignment_of<Value[Capacity]>::value
+ >::type aligned_storage_type;
template <typename V, std::size_t C, typename S>
friend class varray;
@@ -268,9 +267,9 @@ public:
//! @brief The const iterator type.
typedef const_pointer const_iterator;
//! @brief The reverse iterator type.
- typedef container_detail::reverse_iterator<iterator> reverse_iterator;
+ typedef boost::container::reverse_iterator<iterator> reverse_iterator;
//! @brief The const reverse iterator.
- typedef container_detail::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef boost::container::reverse_iterator<const_iterator> const_reverse_iterator;
//! @brief The type of a strategy used by the varray.
typedef Strategy strategy_type;
@@ -836,7 +835,7 @@ public:
{
namespace sv = varray_detail;
- difference_type to_move = std::distance(position, this->end());
+ difference_type to_move = boost::container::iterator_distance(position, this->end());
// TODO - should following lines check for exception and revert to the old size?
@@ -883,9 +882,7 @@ public:
template <typename Iterator>
iterator insert(iterator position, Iterator first, Iterator last)
{
- typedef typename std::iterator_traits<Iterator>::iterator_category category;
- this->insert_dispatch(position, first, last, category());
-
+ this->insert_dispatch(position, first, last);
return position;
}
@@ -937,7 +934,7 @@ public:
errh::check_iterator_end_eq(*this, first);
errh::check_iterator_end_eq(*this, last);
- difference_type n = std::distance(first, last);
+ difference_type n = boost::container::iterator_distance(first, last);
//TODO - add invalid range check?
//BOOST_ASSERT_MSG(0 <= n, "invalid range");
@@ -966,8 +963,7 @@ public:
template <typename Iterator>
void assign(Iterator first, Iterator last)
{
- typedef typename std::iterator_traits<Iterator>::iterator_category category;
- this->assign_dispatch(first, last, category()); // may throw
+ this->assign_dispatch(first, last); // may throw
}
//! @pre <tt>count <= capacity()</tt>
@@ -1002,7 +998,7 @@ public:
}
#if !defined(BOOST_CONTAINER_VARRAY_DISABLE_EMPLACE)
-#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! @pre <tt>size() < capacity()</tt>
//!
//! @brief Inserts a Value constructed with
@@ -1073,8 +1069,9 @@ public:
++m_size; // update end
sv::move_backward(position, this->end() - 2, this->end() - 1); // may throw
- aligned_storage<sizeof(value_type), alignment_of<value_type>::value> temp_storage;
- value_type * val_p = static_cast<value_type *>(temp_storage.address());
+ typename aligned_storage
+ <sizeof(value_type), alignment_of<value_type>::value>::type temp_storage;
+ value_type * val_p = static_cast<value_type*>(static_cast<void*>(&temp_storage));
sv::construct(dti(), val_p, ::boost::forward<Args>(args)...); // may throw
sv::scoped_destructor<value_type> d(val_p);
sv::assign(position, ::boost::move(*val_p)); // may throw
@@ -1083,63 +1080,51 @@ public:
return position;
}
-#else // BOOST_CONTAINER_PERFECT_FORWARDING || BOOST_CONTAINER_DOXYGEN_INVOKED
-
- #define BOOST_PP_LOCAL_MACRO(n) \
- BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \
- void emplace_back(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- { \
- typedef typename vt::disable_trivial_init dti; \
- \
- errh::check_capacity(*this, m_size + 1); /*may throw*/\
- \
- namespace sv = varray_detail; \
- sv::construct(dti(), this->end() BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); /*may throw*/\
- ++m_size; /*update end*/ \
- } \
- //
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
- #define BOOST_PP_LOCAL_MACRO(n) \
- BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \
- iterator emplace(iterator position BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- { \
- typedef typename vt::disable_trivial_init dti; \
- namespace sv = varray_detail; \
- \
- errh::check_iterator_end_eq(*this, position); \
- errh::check_capacity(*this, m_size + 1); /*may throw*/\
- \
- if ( position == this->end() ) \
- { \
- sv::construct(dti(), position BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); /*may throw*/\
- ++m_size; /*update end*/ \
- } \
- else \
- { \
- /* TODO - should following lines check for exception and revert to the old size? */ \
- /* TODO - should move be used only if it's nonthrowing? */ \
- \
- value_type & r = *(this->end() - 1); \
- sv::construct(dti(), this->end(), boost::move(r)); /*may throw*/\
- ++m_size; /*update end*/ \
- sv::move_backward(position, this->end() - 2, this->end() - 1); /*may throw*/\
- \
- aligned_storage<sizeof(value_type), alignment_of<value_type>::value> temp_storage; \
- value_type * val_p = static_cast<value_type *>(temp_storage.address()); \
- sv::construct(dti(), val_p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); /*may throw*/\
- sv::scoped_destructor<value_type> d(val_p); \
- sv::assign(position, ::boost::move(*val_p)); /*may throw*/\
- } \
- \
- return position; \
- } \
- //
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
-#endif // BOOST_CONTAINER_PERFECT_FORWARDING || BOOST_CONTAINER_DOXYGEN_INVOKED
+#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || BOOST_CONTAINER_DOXYGEN_INVOKED
+
+ #define BOOST_CONTAINER_VARRAY_EMPLACE_CODE(N) \
+ BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
+ void emplace_back(BOOST_MOVE_UREF##N)\
+ {\
+ typedef typename vt::disable_trivial_init dti;\
+ errh::check_capacity(*this, m_size + 1);/*may throw*/\
+ \
+ namespace sv = varray_detail;\
+ sv::construct(dti(), this->end() BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\
+ ++m_size; /*update end*/\
+ }\
+ \
+ BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
+ iterator emplace(iterator position BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
+ {\
+ typedef typename vt::disable_trivial_init dti;\
+ namespace sv = varray_detail;\
+ errh::check_iterator_end_eq(*this, position);\
+ errh::check_capacity(*this, m_size + 1); /*may throw*/\
+ if ( position == this->end() ){\
+ sv::construct(dti(), position BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\
+ ++m_size; /*update end*/\
+ }\
+ else{\
+ /* TODO - should following lines check for exception and revert to the old size? */\
+ /* TODO - should move be used only if it's nonthrowing? */\
+ value_type & r = *(this->end() - 1);\
+ sv::construct(dti(), this->end(), boost::move(r));/*may throw*/\
+ ++m_size; /*update end*/\
+ sv::move_backward(position, this->end() - 2, this->end() - 1);/*may throw*/\
+ typename aligned_storage\
+ <sizeof(value_type), alignment_of<value_type>::value>::type temp_storage;\
+ value_type * val_p = static_cast<value_type*>(static_cast<void*>(&temp_storage));\
+ sv::construct(dti(), val_p BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\
+ sv::scoped_destructor<value_type> d(val_p);\
+ sv::assign(position, ::boost::move(*val_p));/*may throw*/\
+ }\
+ return position;\
+ }\
+ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_VARRAY_EMPLACE_CODE)
+ #undef BOOST_CONTAINER_VARRAY_EMPLACE_CODE
+
+#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || BOOST_CONTAINER_DOXYGEN_INVOKED
#endif // !BOOST_CONTAINER_VARRAY_DISABLE_EMPLACE
//! @brief Removes all elements from the container.
@@ -1319,7 +1304,7 @@ public:
//! Constant O(1).
Value * data()
{
- return boost::addressof(*(this->ptr()));
+ return (addressof)(*(this->ptr()));
}
//! @brief Const pointer such that <tt>[data(), data() + size())</tt> is a valid range.
@@ -1332,7 +1317,7 @@ public:
//! Constant O(1).
const Value * data() const
{
- return boost::addressof(*(this->ptr()));
+ return (addressof)(*(this->ptr()));
}
@@ -1526,7 +1511,7 @@ private:
// @par Complexity
// Linear O(N).
template <std::size_t C, typename S>
- void move_ctor_dispatch(varray<value_type, C, S> & other, boost::true_type /*use_memop*/)
+ void move_ctor_dispatch(varray<value_type, C, S> & other, true_type /*use_memop*/)
{
::memcpy(this->data(), other.data(), sizeof(Value) * other.m_size);
m_size = other.m_size;
@@ -1538,7 +1523,7 @@ private:
// @par Complexity
// Linear O(N).
template <std::size_t C, typename S>
- void move_ctor_dispatch(varray<value_type, C, S> & other, boost::false_type /*use_memop*/)
+ void move_ctor_dispatch(varray<value_type, C, S> & other, false_type /*use_memop*/)
{
namespace sv = varray_detail;
sv::uninitialized_move_if_noexcept(other.begin(), other.end(), this->begin()); // may throw
@@ -1550,12 +1535,12 @@ private:
// @par Complexity
// Linear O(N).
template <std::size_t C, typename S>
- void move_assign_dispatch(varray<value_type, C, S> & other, boost::true_type /*use_memop*/)
+ void move_assign_dispatch(varray<value_type, C, S> & other, true_type /*use_memop*/)
{
this->clear();
::memcpy(this->data(), other.data(), sizeof(Value) * other.m_size);
- boost::swap(m_size, other.m_size);
+ boost::adl_move_swap(m_size, other.m_size);
}
// @par Throws
@@ -1564,7 +1549,7 @@ private:
// @par Complexity
// Linear O(N).
template <std::size_t C, typename S>
- void move_assign_dispatch(varray<value_type, C, S> & other, boost::false_type /*use_memop*/)
+ void move_assign_dispatch(varray<value_type, C, S> & other, false_type /*use_memop*/)
{
namespace sv = varray_detail;
if ( m_size <= static_cast<size_type>(other.size()) )
@@ -1586,24 +1571,24 @@ private:
// @par Complexity
// Linear O(N).
template <std::size_t C, typename S>
- void swap_dispatch(varray<value_type, C, S> & other, boost::true_type const& /*use_optimized_swap*/)
+ void swap_dispatch(varray<value_type, C, S> & other, true_type const& /*use_optimized_swap*/)
{
typedef typename
- boost::mpl::if_c<
+ if_c<
Capacity < C,
aligned_storage_type,
typename varray<value_type, C, S>::aligned_storage_type
>::type
storage_type;
- storage_type temp;
- Value * temp_ptr = reinterpret_cast<Value*>(temp.address());
+ storage_type temp_storage;
+ value_type * temp_ptr = static_cast<value_type*>(static_cast<void*>(&temp_storage));
::memcpy(temp_ptr, this->data(), sizeof(Value) * this->size());
::memcpy(this->data(), other.data(), sizeof(Value) * other.size());
::memcpy(other.data(), temp_ptr, sizeof(Value) * this->size());
- boost::swap(m_size, other.m_size);
+ boost::adl_move_swap(m_size, other.m_size);
}
// @par Throws
@@ -1612,7 +1597,7 @@ private:
// @par Complexity
// Linear O(N).
template <std::size_t C, typename S>
- void swap_dispatch(varray<value_type, C, S> & other, boost::false_type const& /*use_optimized_swap*/)
+ void swap_dispatch(varray<value_type, C, S> & other, false_type const& /*use_optimized_swap*/)
{
namespace sv = varray_detail;
@@ -1623,46 +1608,45 @@ private:
swap_dispatch_impl(this->begin(), this->end(), other.begin(), other.end(), use_memop_in_swap_and_move()); // may throw
else
swap_dispatch_impl(other.begin(), other.end(), this->begin(), this->end(), use_memop_in_swap_and_move()); // may throw
- boost::swap(m_size, other.m_size);
+ boost::adl_move_swap(m_size, other.m_size);
}
// @par Throws
// Nothing.
// @par Complexity
// Linear O(N).
- void swap_dispatch_impl(iterator first_sm, iterator last_sm, iterator first_la, iterator last_la, boost::true_type const& /*use_memop*/)
+ void swap_dispatch_impl(iterator first_sm, iterator last_sm, iterator first_la, iterator last_la, true_type const& /*use_memop*/)
{
- //BOOST_ASSERT_MSG(std::distance(first_sm, last_sm) <= std::distance(first_la, last_la));
+ //BOOST_ASSERT_MSG(boost::container::iterator_distance(first_sm, last_sm) <= boost::container::iterator_distance(first_la, last_la));
namespace sv = varray_detail;
for (; first_sm != last_sm ; ++first_sm, ++first_la)
{
- boost::aligned_storage<
+ typename aligned_storage<
sizeof(value_type),
- boost::alignment_of<value_type>::value
- > temp_storage;
- value_type * temp_ptr = reinterpret_cast<value_type*>(temp_storage.address());
-
- ::memcpy(temp_ptr, boost::addressof(*first_sm), sizeof(value_type));
- ::memcpy(boost::addressof(*first_sm), boost::addressof(*first_la), sizeof(value_type));
- ::memcpy(boost::addressof(*first_la), temp_ptr, sizeof(value_type));
+ alignment_of<value_type>::value
+ >::type temp_storage;
+ value_type * temp_ptr = static_cast<value_type*>(static_cast<void*>(&temp_storage));
+ ::memcpy(temp_ptr, (addressof)(*first_sm), sizeof(value_type));
+ ::memcpy((addressof)(*first_sm), (addressof)(*first_la), sizeof(value_type));
+ ::memcpy((addressof)(*first_la), temp_ptr, sizeof(value_type));
}
- ::memcpy(first_sm, first_la, sizeof(value_type) * std::distance(first_la, last_la));
+ ::memcpy(first_sm, first_la, sizeof(value_type) * boost::container::iterator_distance(first_la, last_la));
}
// @par Throws
// If Value's move constructor or move assignment throws.
// @par Complexity
// Linear O(N).
- void swap_dispatch_impl(iterator first_sm, iterator last_sm, iterator first_la, iterator last_la, boost::false_type const& /*use_memop*/)
+ void swap_dispatch_impl(iterator first_sm, iterator last_sm, iterator first_la, iterator last_la, false_type const& /*use_memop*/)
{
- //BOOST_ASSERT_MSG(std::distance(first_sm, last_sm) <= std::distance(first_la, last_la));
+ //BOOST_ASSERT_MSG(boost::container::iterator_distance(first_sm, last_sm) <= boost::container::iterator_distance(first_la, last_la));
namespace sv = varray_detail;
for (; first_sm != last_sm ; ++first_sm, ++first_la)
{
- //boost::swap(*first_sm, *first_la); // may throw
+ //boost::adl_move_swap(*first_sm, *first_la); // may throw
value_type temp(boost::move(*first_sm)); // may throw
*first_sm = boost::move(*first_la); // may throw
*first_la = boost::move(temp); // may throw
@@ -1715,12 +1699,12 @@ private:
// @par Complexity
// Linear O(N).
template <typename Iterator>
- void insert_dispatch(iterator position, Iterator first, Iterator last, std::random_access_iterator_tag)
+ typename iterator_enable_if_tag<Iterator, std::random_access_iterator_tag>::type
+ insert_dispatch(iterator position, Iterator first, Iterator last)
{
errh::check_iterator_end_eq(*this, position);
- typename boost::iterator_difference<Iterator>::type
- count = std::distance(first, last);
+ size_type count = boost::container::iterator_distance(first, last);
errh::check_capacity(*this, m_size + count); // may throw
@@ -1743,7 +1727,8 @@ private:
// @par Complexity
// Linear O(N).
template <typename Iterator, typename Category>
- void insert_dispatch(iterator position, Iterator first, Iterator last, Category const& /*not_random_access*/)
+ typename iterator_disable_if_tag<Iterator, std::random_access_iterator_tag>::type
+ insert_dispatch(iterator position, Iterator first, Iterator last)
{
errh::check_iterator_end_eq(*this, position);
@@ -1751,7 +1736,7 @@ private:
{
namespace sv = varray_detail;
- std::ptrdiff_t d = std::distance(position, this->begin() + Capacity);
+ std::ptrdiff_t d = boost::container::iterator_distance(position, this->begin() + Capacity);
std::size_t count = sv::uninitialized_copy_s(first, last, position, d); // may throw
errh::check_capacity(*this, count <= static_cast<std::size_t>(d) ? m_size + count : Capacity + 1); // may throw
@@ -1760,8 +1745,7 @@ private:
}
else
{
- typename boost::iterator_difference<Iterator>::type
- count = std::distance(first, last);
+ size_type count = boost::container::iterator_distance(first, last);
errh::check_capacity(*this, m_size + count); // may throw
@@ -1779,7 +1763,7 @@ private:
{
namespace sv = varray_detail;
- difference_type to_move = std::distance(position, this->end());
+ difference_type to_move = boost::container::iterator_distance(position, this->end());
// TODO - should following lines check for exception and revert to the old size?
@@ -1793,7 +1777,7 @@ private:
else
{
Iterator middle_iter = first;
- std::advance(middle_iter, to_move);
+ boost::container::iterator_advance(middle_iter, to_move);
sv::uninitialized_copy(middle_iter, last, this->end()); // may throw
m_size += count - to_move; // update end
@@ -1810,12 +1794,12 @@ private:
// @par Complexity
// Linear O(N).
template <typename Iterator>
- void assign_dispatch(Iterator first, Iterator last, std::random_access_iterator_tag const& /*not_random_access*/)
+ typename iterator_enable_if_tag<Iterator, std::random_access_iterator_tag>::type
+ assign_dispatch(Iterator first, Iterator last)
{
namespace sv = varray_detail;
- typename boost::iterator_difference<Iterator>::type
- s = std::distance(first, last);
+ size_type s = boost::container::iterator_distance(first, last);
errh::check_capacity(*this, s); // may throw
@@ -1838,7 +1822,8 @@ private:
// @par Complexity
// Linear O(N).
template <typename Iterator, typename Category>
- void assign_dispatch(Iterator first, Iterator last, Category const& /*not_random_access*/)
+ typename iterator_disable_if_tag<Iterator, std::random_access_iterator_tag>::type
+ assign_dispatch(Iterator first, Iterator last)
{
namespace sv = varray_detail;
@@ -1850,7 +1835,7 @@ private:
sv::destroy(it, this->end());
- std::ptrdiff_t d = std::distance(it, this->begin() + Capacity);
+ std::ptrdiff_t d = boost::container::iterator_distance(it, this->begin() + Capacity);
std::size_t count = sv::uninitialized_copy_s(first, last, it, d); // may throw
s += count;
@@ -1861,12 +1846,12 @@ private:
pointer ptr()
{
- return pointer(static_cast<Value*>(m_storage.address()));
+ return pointer(static_cast<Value*>(static_cast<void*>(&m_storage)));
}
const_pointer ptr() const
{
- return const_pointer(static_cast<const Value*>(m_storage.address()));
+ return pointer(static_cast<const Value*>(static_cast<const void*>(&m_storage)));
}
size_type m_size;
@@ -1896,8 +1881,8 @@ public:
typedef pointer iterator;
typedef const_pointer const_iterator;
- typedef container_detail::reverse_iterator<iterator> reverse_iterator;
- typedef container_detail::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef boost::container::reverse_iterator<iterator> reverse_iterator;
+ typedef boost::container::reverse_iterator<const_iterator> const_reverse_iterator;
// nothrow
varray() {}
@@ -1931,7 +1916,7 @@ public:
template <typename Iterator>
varray(Iterator first, Iterator last)
{
- errh::check_capacity(*this, std::distance(first, last)); // may throw
+ errh::check_capacity(*this, boost::container::iterator_distance(first, last)); // may throw
}
// basic
@@ -2001,7 +1986,7 @@ public:
template <typename Iterator>
void insert(iterator, Iterator first, Iterator last)
{
- errh::check_capacity(*this, std::distance(first, last)); // may throw
+ errh::check_capacity(*this, boost::container::iterator_distance(first, last)); // may throw
}
// basic
@@ -2023,7 +2008,7 @@ public:
template <typename Iterator>
void assign(Iterator first, Iterator last)
{
- errh::check_capacity(*this, std::distance(first, last)); // may throw
+ errh::check_capacity(*this, boost::container::iterator_distance(first, last)); // may throw
}
// basic
@@ -2092,8 +2077,8 @@ public:
}
// nothrow
- Value * data() { return boost::addressof(*(this->ptr())); }
- const Value * data() const { return boost::addressof(*(this->ptr())); }
+ Value * data() { return (addressof)(*(this->ptr())); }
+ const Value * data() const { return (addressof)(*(this->ptr())); }
// nothrow
iterator begin() { return this->ptr(); }
@@ -2145,7 +2130,7 @@ private:
template<typename V, std::size_t C1, typename S1, std::size_t C2, typename S2>
bool operator== (varray<V, C1, S1> const& x, varray<V, C2, S2> const& y)
{
- return x.size() == y.size() && std::equal(x.begin(), x.end(), y.begin());
+ return x.size() == y.size() && ::boost::container::algo_equal(x.begin(), x.end(), y.begin());
}
//! @brief Checks if contents of two varrays are not equal.
@@ -2179,7 +2164,7 @@ bool operator!= (varray<V, C1, S1> const& x, varray<V, C2, S2> const& y)
template<typename V, std::size_t C1, typename S1, std::size_t C2, typename S2>
bool operator< (varray<V, C1, S1> const& x, varray<V, C2, S2> const& y)
{
- return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
+ return ::boost::container::algo_lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
}
//! @brief Lexicographically compares varrays.
diff --git a/libs/container/bench/detail/varray_concept.hpp b/libs/container/bench/detail/varray_concept.hpp
index 103c60b47..6f044a9ac 100644
--- a/libs/container/bench/detail/varray_concept.hpp
+++ b/libs/container/bench/detail/varray_concept.hpp
@@ -17,14 +17,14 @@ namespace boost { namespace container { namespace container_detail { namespace c
/**
* VArrayStrategyConcept
*
- * \brief Checks strategy for varray<Value,Capacity,Strategy>, which has similarities to std::Allocator
+ * \brief Checks strategy for varray<Value,Capacity,Strategy>, which has similarities to std::allocator
* \ingroup varray
*/
template<typename Strategy>
struct VArrayStrategy {
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
- // typedefs are the same as in std::Allocator
+ // typedefs are the same as in std::allocator
typedef typename Strategy::value_type value_type;
typedef typename Strategy::size_type size_type;
typedef typename Strategy::difference_type difference_type;
diff --git a/libs/container/bench/detail/varray_util.hpp b/libs/container/bench/detail/varray_util.hpp
index d76d13fe4..8a97142dd 100644
--- a/libs/container/bench/detail/varray_util.hpp
+++ b/libs/container/bench/detail/varray_util.hpp
@@ -17,26 +17,20 @@
#include <memory>
#include <limits>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/int.hpp>
-
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/type_traits/has_trivial_assign.hpp>
-#include <boost/type_traits/has_trivial_copy.hpp>
-#include <boost/type_traits/has_trivial_constructor.hpp>
-#include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/move/traits.hpp>
-#include <boost/iterator/iterator_traits.hpp>
-
-#include <boost/core/no_exceptions_support.hpp>
#include <boost/config.hpp>
-#include <boost/move/utility_core.hpp>
+#include <boost/core/no_exceptions_support.hpp>
+
+#include <boost/container/detail/addressof.hpp>
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+#include <boost/move/detail/fwd_macros.hpp>
+#endif
+#include <boost/container/detail/iterator.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/container/detail/type_traits.hpp>
+
#include <boost/move/algorithm.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/move/traits.hpp>
+#include <boost/move/utility_core.hpp>
// TODO - move vectors iterators optimization to the other, optional file instead of checking defines?
@@ -47,22 +41,24 @@
namespace boost { namespace container { namespace varray_detail {
+namespace bcd = ::boost::container::container_detail;
+
template <typename I>
-struct are_elements_contiguous : boost::is_pointer<I>
+struct are_elements_contiguous : boost::container::container_detail::is_pointer<I>
{};
#if defined(BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION) && !defined(BOOST_NO_EXCEPTIONS)
template <typename Pointer>
struct are_elements_contiguous<
- boost::container::container_detail::vector_const_iterator<Pointer>
-> : boost::true_type
+ bcd::vector_const_iterator<Pointer>
+> : bcd::true_type
{};
template <typename Pointer>
struct are_elements_contiguous<
- boost::container::container_detail::vector_iterator<Pointer>
-> : boost::true_type
+ bcd::vector_iterator<Pointer>
+> : bcd::true_type
{};
#if defined(BOOST_DINKUMWARE_STDLIB)
@@ -70,21 +66,21 @@ struct are_elements_contiguous<
template <typename T>
struct are_elements_contiguous<
std::_Vector_const_iterator<T>
-> : boost::true_type
+> : bcd::true_type
{};
template <typename T>
struct are_elements_contiguous<
std::_Vector_iterator<T>
-> : boost::true_type
+> : bcd::true_type
{};
#elif defined(BOOST_GNU_STDLIB)
-template <typename P, typename T, typename A>
+template <typename P, typename T, typename Allocator>
struct are_elements_contiguous<
- __gnu_cxx::__normal_iterator<P, std::vector<T, A> >
-> : boost::true_type
+ __gnu_cxx::__normal_iterator<P, std::vector<T, Allocator> >
+> : bcd::true_type
{};
#elif defined(_LIBCPP_VERSION)
@@ -93,7 +89,7 @@ struct are_elements_contiguous<
//template <typename P>
//struct are_elements_contiguous<
// __wrap_iter<P>
-//> : boost::true_type
+//> : bcd::true_type
//{};
#else // OTHER_STDLIB
@@ -104,48 +100,42 @@ struct are_elements_contiguous<
#endif // BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION && !BOOST_NO_EXCEPTIONS
-}}} // namespace boost::container::varray_detail
-
-namespace boost { namespace container { namespace varray_detail {
-
template <typename I, typename O>
struct are_corresponding :
- ::boost::mpl::and_<
- ::boost::is_same<
- ::boost::remove_const<
- typename ::boost::iterator_value<I>::type
+ bcd::bool_<
+ bcd::is_same<
+ bcd::remove_const<
+ typename ::boost::container::iterator_traits<I>::value_type
>,
- ::boost::remove_const<
- typename ::boost::iterator_value<O>::type
+ bcd::remove_const<
+ typename ::boost::container::iterator_traits<O>::value_type
>
- >,
- are_elements_contiguous<I>,
- are_elements_contiguous<O>
+ >::value &&
+ are_elements_contiguous<I>::value &&
+ are_elements_contiguous<O>::value
>
{};
template <typename I, typename V>
struct is_corresponding_value :
- ::boost::is_same<
- ::boost::remove_const<
- typename ::boost::iterator_value<I>::type
- >,
- ::boost::remove_const<V>
- >
+ bcd::bool_<
+ bcd::is_same<
+ bcd::remove_const<typename ::boost::container::iterator_traits<I>::value_type>,
+ bcd::remove_const<V>
+ >::value
+ >
{};
// destroy(I, I)
template <typename I>
-void destroy_dispatch(I /*first*/, I /*last*/,
- boost::true_type const& /*has_trivial_destructor*/)
+void destroy_dispatch(I /*first*/, I /*last*/, bcd::true_type const& /*is_trivially_destructible*/)
{}
template <typename I>
-void destroy_dispatch(I first, I last,
- boost::false_type const& /*has_trivial_destructor*/)
+void destroy_dispatch(I first, I last, bcd::false_type const& /*is_trivially_destructible*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
for ( ; first != last ; ++first )
first->~value_type();
}
@@ -153,48 +143,45 @@ void destroy_dispatch(I first, I last,
template <typename I>
void destroy(I first, I last)
{
- typedef typename boost::iterator_value<I>::type value_type;
- destroy_dispatch(first, last, has_trivial_destructor<value_type>());
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ destroy_dispatch(first, last, bcd::bool_<bcd::is_trivially_destructible<value_type>::value>());
}
// destroy(I)
template <typename I>
void destroy_dispatch(I /*pos*/,
- boost::true_type const& /*has_trivial_destructor*/)
+ bcd::true_type const& /*is_trivially_destructible*/)
{}
template <typename I>
void destroy_dispatch(I pos,
- boost::false_type const& /*has_trivial_destructor*/)
+ bcd::false_type const& /*is_trivially_destructible*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
pos->~value_type();
}
template <typename I>
void destroy(I pos)
{
- typedef typename boost::iterator_value<I>::type value_type;
- destroy_dispatch(pos, has_trivial_destructor<value_type>());
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ destroy_dispatch(pos, bcd::bool_<bcd::is_trivially_destructible<value_type>::value>());
}
// copy(I, I, O)
template <typename I, typename O>
-inline O copy_dispatch(I first, I last, O dst,
- boost::mpl::bool_<true> const& /*use_memmove*/)
+inline O copy_dispatch(I first, I last, O dst, bcd::true_type const& /*use_memmove*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
- typename boost::iterator_difference<I>::type d = std::distance(first, last);
-
- ::memmove(boost::addressof(*dst), boost::addressof(*first), sizeof(value_type) * d);
- return dst + d;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ const std::size_t d = boost::container::iterator_distance(first, last);
+ ::memmove(boost::container::container_detail::addressof(*dst), boost::container::container_detail::addressof(*first), sizeof(value_type) * d);
+ return dst + d;
}
template <typename I, typename O>
-inline O copy_dispatch(I first, I last, O dst,
- boost::mpl::bool_<false> const& /*use_memmove*/)
+inline O copy_dispatch(I first, I last, O dst, bcd::false_type const& /*use_memmove*/)
{
return std::copy(first, last, dst); // may throw
}
@@ -202,16 +189,12 @@ inline O copy_dispatch(I first, I last, O dst,
template <typename I, typename O>
inline O copy(I first, I last, O dst)
{
- typedef typename
- ::boost::mpl::and_<
- are_corresponding<I, O>,
- ::boost::has_trivial_assign<
- typename ::boost::iterator_value<O>::type
- >
- >::type
- use_memmove;
+ typedef bcd::bool_
+ < are_corresponding<I, O>::value &&
+ bcd::is_trivially_copy_assignable<typename ::boost::container::iterator_traits<O>::value_type>::value
+ > use_memmove;
- return copy_dispatch(first, last, dst, use_memmove()); // may throw
+ return copy_dispatch(first, last, dst, use_memmove()); // may throw
}
// uninitialized_copy(I, I, O)
@@ -219,19 +202,18 @@ inline O copy(I first, I last, O dst)
template <typename I, typename O>
inline
O uninitialized_copy_dispatch(I first, I last, O dst,
- boost::mpl::bool_<true> const& /*use_memcpy*/)
+ bcd::true_type const& /*use_memcpy*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
- typename boost::iterator_difference<I>::type d = std::distance(first, last);
-
- ::memcpy(boost::addressof(*dst), boost::addressof(*first), sizeof(value_type) * d);
- return dst + d;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ const std::size_t d = boost::container::iterator_distance(first, last);
+ ::memcpy(boost::container::container_detail::addressof(*dst), boost::container::container_detail::addressof(*first), sizeof(value_type) * d);
+ return dst + d;
}
template <typename I, typename F>
inline
F uninitialized_copy_dispatch(I first, I last, F dst,
- boost::mpl::bool_<false> const& /*use_memcpy*/)
+ bcd::false_type const& /*use_memcpy*/)
{
return std::uninitialized_copy(first, last, dst); // may throw
}
@@ -240,16 +222,11 @@ template <typename I, typename F>
inline
F uninitialized_copy(I first, I last, F dst)
{
- typedef typename
- ::boost::mpl::and_<
- are_corresponding<I, F>,
- ::boost::has_trivial_copy<
- typename ::boost::iterator_value<F>::type
- >
- >::type
- use_memcpy;
-
- return uninitialized_copy_dispatch(first, last, dst, use_memcpy()); // may throw
+ typedef bcd::bool_
+ < are_corresponding<I, F>::value &&
+ bcd::is_trivially_copy_constructible<typename ::boost::container::iterator_traits<F>::value_type>::value
+ > use_memcpy;
+ return uninitialized_copy_dispatch(first, last, dst, use_memcpy()); // may throw
}
// uninitialized_move(I, I, O)
@@ -257,19 +234,18 @@ F uninitialized_copy(I first, I last, F dst)
template <typename I, typename O>
inline
O uninitialized_move_dispatch(I first, I last, O dst,
- boost::mpl::bool_<true> const& /*use_memcpy*/)
+ bcd::true_type const& /*use_memcpy*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
- typename boost::iterator_difference<I>::type d = std::distance(first, last);
-
- ::memcpy(boost::addressof(*dst), boost::addressof(*first), sizeof(value_type) * d);
- return dst + d;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ const std::size_t d = boost::container::iterator_distance(first, last);
+ ::memcpy(boost::container::container_detail::addressof(*dst), boost::container::container_detail::addressof(*first), sizeof(value_type) * d);
+ return dst + d;
}
template <typename I, typename O>
inline
O uninitialized_move_dispatch(I first, I last, O dst,
- boost::mpl::bool_<false> const& /*use_memcpy*/)
+ bcd::false_type const& /*use_memcpy*/)
{
//return boost::uninitialized_move(first, last, dst); // may throw
@@ -277,9 +253,9 @@ O uninitialized_move_dispatch(I first, I last, O dst,
BOOST_TRY
{
- typedef typename std::iterator_traits<O>::value_type value_type;
+ typedef typename boost::container::iterator_traits<O>::value_type value_type;
for (; first != last; ++first, ++o )
- new (boost::addressof(*o)) value_type(boost::move(*first));
+ new (boost::container::container_detail::addressof(*o)) value_type(boost::move(*first));
}
BOOST_CATCH(...)
{
@@ -295,16 +271,11 @@ template <typename I, typename O>
inline
O uninitialized_move(I first, I last, O dst)
{
- typedef typename
- ::boost::mpl::and_<
- are_corresponding<I, O>,
- ::boost::has_trivial_copy<
- typename ::boost::iterator_value<O>::type
- >
- >::type
- use_memcpy;
-
- return uninitialized_move_dispatch(first, last, dst, use_memcpy()); // may throw
+ typedef bcd::bool_
+ < are_corresponding<I, O>::value &&
+ bcd::is_trivially_copy_constructible<typename ::boost::container::iterator_traits<O>::value_type>::value
+ > use_memcpy;
+ return uninitialized_move_dispatch(first, last, dst, use_memcpy()); // may throw
}
// TODO - move uses memmove - implement 2nd version using memcpy?
@@ -314,37 +285,31 @@ O uninitialized_move(I first, I last, O dst)
template <typename I, typename O>
inline
O move_dispatch(I first, I last, O dst,
- boost::mpl::bool_<true> const& /*use_memmove*/)
+ bcd::true_type const& /*use_memmove*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
- typename boost::iterator_difference<I>::type d = std::distance(first, last);
-
- ::memmove(boost::addressof(*dst), boost::addressof(*first), sizeof(value_type) * d);
- return dst + d;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ const std::size_t d = boost::container::iterator_distance(first, last);
+ ::memmove(boost::container::container_detail::addressof(*dst), boost::container::container_detail::addressof(*first), sizeof(value_type)*d );
+ return dst + d;
}
template <typename I, typename O>
inline
O move_dispatch(I first, I last, O dst,
- boost::mpl::bool_<false> const& /*use_memmove*/)
+ bcd::false_type const& /*use_memmove*/)
{
- return boost::move(first, last, dst); // may throw
+ return boost::move(first, last, dst); // may throw
}
template <typename I, typename O>
inline
O move(I first, I last, O dst)
{
- typedef typename
- ::boost::mpl::and_<
- are_corresponding<I, O>,
- ::boost::has_trivial_assign<
- typename ::boost::iterator_value<O>::type
- >
- >::type
- use_memmove;
-
- return move_dispatch(first, last, dst, use_memmove()); // may throw
+ typedef bcd::bool_
+ < are_corresponding<I, O>::value &&
+ bcd::is_trivially_copy_constructible<typename ::boost::container::iterator_traits<O>::value_type>::value
+ > use_memmove;
+ return move_dispatch(first, last, dst, use_memmove()); // may throw
}
// move_backward(BDI, BDI, BDO)
@@ -352,20 +317,19 @@ O move(I first, I last, O dst)
template <typename BDI, typename BDO>
inline
BDO move_backward_dispatch(BDI first, BDI last, BDO dst,
- boost::mpl::bool_<true> const& /*use_memmove*/)
+ bcd::true_type const& /*use_memmove*/)
{
- typedef typename boost::iterator_value<BDI>::type value_type;
- typename boost::iterator_difference<BDI>::type d = std::distance(first, last);
-
+ typedef typename ::boost::container::iterator_traits<BDI>::value_type value_type;
+ const std::size_t d = boost::container::iterator_distance(first, last);
BDO foo(dst - d);
- ::memmove(boost::addressof(*foo), boost::addressof(*first), sizeof(value_type) * d);
+ ::memmove(boost::container::container_detail::addressof(*foo), boost::container::container_detail::addressof(*first), sizeof(value_type) * d);
return foo;
}
template <typename BDI, typename BDO>
inline
BDO move_backward_dispatch(BDI first, BDI last, BDO dst,
- boost::mpl::bool_<false> const& /*use_memmove*/)
+ bcd::false_type const& /*use_memmove*/)
{
return boost::move_backward(first, last, dst); // may throw
}
@@ -374,29 +338,21 @@ template <typename BDI, typename BDO>
inline
BDO move_backward(BDI first, BDI last, BDO dst)
{
- typedef typename
- ::boost::mpl::and_<
- are_corresponding<BDI, BDO>,
- ::boost::has_trivial_assign<
- typename ::boost::iterator_value<BDO>::type
- >
- >::type
- use_memmove;
-
- return move_backward_dispatch(first, last, dst, use_memmove()); // may throw
+ typedef bcd::bool_
+ < are_corresponding<BDI, BDO>::value &&
+ bcd::is_trivially_copy_constructible<typename ::boost::container::iterator_traits<BDO>::value_type>::value
+ > use_memmove;
+ return move_backward_dispatch(first, last, dst, use_memmove()); // may throw
}
template <typename T>
struct has_nothrow_move : public
- ::boost::mpl::or_<
- boost::mpl::bool_<
- ::boost::has_nothrow_move<
- typename ::boost::remove_const<T>::type
- >::value
- >,
- boost::mpl::bool_<
- ::boost::has_nothrow_move<T>::value
- >
+ bcd::bool_<
+ ::boost::has_nothrow_move<
+ typename bcd::remove_const<T>::type
+ >::value
+ ||
+ ::boost::has_nothrow_move<T>::value
>
{};
@@ -404,21 +360,21 @@ struct has_nothrow_move : public
template <typename I, typename O>
inline
-O uninitialized_move_if_noexcept_dispatch(I first, I last, O dst, boost::mpl::bool_<true> const& /*use_move*/)
+O uninitialized_move_if_noexcept_dispatch(I first, I last, O dst, bcd::true_type const& /*use_move*/)
{ return uninitialized_move(first, last, dst); }
template <typename I, typename O>
inline
-O uninitialized_move_if_noexcept_dispatch(I first, I last, O dst, boost::mpl::bool_<false> const& /*use_move*/)
+O uninitialized_move_if_noexcept_dispatch(I first, I last, O dst, bcd::false_type const& /*use_move*/)
{ return uninitialized_copy(first, last, dst); }
template <typename I, typename O>
inline
O uninitialized_move_if_noexcept(I first, I last, O dst)
{
- typedef typename has_nothrow_move<
- typename ::boost::iterator_value<O>::type
- >::type use_move;
+ typedef has_nothrow_move<
+ typename ::boost::container::iterator_traits<O>::value_type
+ > use_move;
return uninitialized_move_if_noexcept_dispatch(first, last, dst, use_move()); // may throw
}
@@ -427,21 +383,21 @@ O uninitialized_move_if_noexcept(I first, I last, O dst)
template <typename I, typename O>
inline
-O move_if_noexcept_dispatch(I first, I last, O dst, boost::mpl::bool_<true> const& /*use_move*/)
+O move_if_noexcept_dispatch(I first, I last, O dst, bcd::true_type const& /*use_move*/)
{ return move(first, last, dst); }
template <typename I, typename O>
inline
-O move_if_noexcept_dispatch(I first, I last, O dst, boost::mpl::bool_<false> const& /*use_move*/)
+O move_if_noexcept_dispatch(I first, I last, O dst, bcd::false_type const& /*use_move*/)
{ return copy(first, last, dst); }
template <typename I, typename O>
inline
O move_if_noexcept(I first, I last, O dst)
{
- typedef typename has_nothrow_move<
- typename ::boost::iterator_value<O>::type
- >::type use_move;
+ typedef has_nothrow_move<
+ typename ::boost::container::iterator_traits<O>::value_type
+ > use_move;
return move_if_noexcept_dispatch(first, last, dst, use_move()); // may throw
}
@@ -451,34 +407,34 @@ O move_if_noexcept(I first, I last, O dst)
template <typename I>
inline
void uninitialized_fill_dispatch(I first, I last,
- boost::true_type const& /*has_trivial_constructor*/,
- boost::true_type const& /*disable_trivial_init*/)
+ bcd::true_type const& /*is_trivially_default_constructible*/,
+ bcd::true_type const& /*disable_trivial_init*/)
{}
template <typename I>
inline
void uninitialized_fill_dispatch(I first, I last,
- boost::true_type const& /*has_trivial_constructor*/,
- boost::false_type const& /*disable_trivial_init*/)
+ bcd::true_type const& /*is_trivially_default_constructible*/,
+ bcd::false_type const& /*disable_trivial_init*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
for ( ; first != last ; ++first )
- new (boost::addressof(*first)) value_type();
+ new (boost::container::container_detail::addressof(*first)) value_type();
}
template <typename I, typename DisableTrivialInit>
inline
void uninitialized_fill_dispatch(I first, I last,
- boost::false_type const& /*has_trivial_constructor*/,
+ bcd::false_type const& /*is_trivially_default_constructible*/,
DisableTrivialInit const& /*not_used*/)
{
- typedef typename boost::iterator_value<I>::type value_type;
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
I it = first;
BOOST_TRY
{
for ( ; it != last ; ++it )
- new (boost::addressof(*it)) value_type(); // may throw
+ new (boost::container::container_detail::addressof(*it)) value_type(); // may throw
}
BOOST_CATCH(...)
{
@@ -492,35 +448,36 @@ template <typename I, typename DisableTrivialInit>
inline
void uninitialized_fill(I first, I last, DisableTrivialInit const& disable_trivial_init)
{
- typedef typename boost::iterator_value<I>::type value_type;
- uninitialized_fill_dispatch(first, last, boost::has_trivial_constructor<value_type>(), disable_trivial_init); // may throw
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ uninitialized_fill_dispatch(first, last
+ , bcd::bool_<bcd::is_trivially_default_constructible<value_type>::value>()
+ , disable_trivial_init); // may throw
}
// construct(I)
template <typename I>
inline
-void construct_dispatch(boost::mpl::bool_<true> const& /*dont_init*/, I pos)
+void construct_dispatch(bcd::true_type const& /*dont_init*/, I pos)
{}
template <typename I>
inline
-void construct_dispatch(boost::mpl::bool_<false> const& /*dont_init*/, I pos)
+void construct_dispatch(bcd::false_type const& /*dont_init*/, I pos)
{
- typedef typename ::boost::iterator_value<I>::type value_type;
- new (static_cast<void*>(::boost::addressof(*pos))) value_type(); // may throw
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ new (static_cast<void*>(::boost::container::container_detail::addressof(*pos))) value_type(); // may throw
}
template <typename DisableTrivialInit, typename I>
inline
void construct(DisableTrivialInit const&, I pos)
{
- typedef typename ::boost::iterator_value<I>::type value_type;
- typedef typename ::boost::mpl::and_<
- boost::has_trivial_constructor<value_type>,
- DisableTrivialInit
- >::type dont_init;
-
+ typedef typename ::boost::container::iterator_traits<I>::value_type value_type;
+ bcd::bool_<
+ bcd::is_trivially_default_constructible<value_type>::value &&
+ DisableTrivialInit::value
+ > dont_init;
construct_dispatch(dont_init(), pos); // may throw
}
@@ -528,34 +485,29 @@ void construct(DisableTrivialInit const&, I pos)
template <typename I, typename V>
inline
-void construct_dispatch(I pos, V const& v,
- boost::mpl::bool_<true> const& /*use_memcpy*/)
+void construct_dispatch(I pos, V const& v, bcd::true_type const& /*use_memcpy*/)
{
- ::memcpy(boost::addressof(*pos), boost::addressof(v), sizeof(V));
+ ::memcpy(boost::container::container_detail::addressof(*pos), boost::container::container_detail::addressof(v), sizeof(V));
}
template <typename I, typename P>
inline
void construct_dispatch(I pos, P const& p,
- boost::mpl::bool_<false> const& /*use_memcpy*/)
+ bcd::false_type const& /*use_memcpy*/)
{
- typedef typename boost::iterator_value<I>::type V;
- new (static_cast<void*>(boost::addressof(*pos))) V(p); // may throw
+ typedef typename ::boost::container::iterator_traits<I>::value_type V;
+ new (static_cast<void*>(boost::container::container_detail::addressof(*pos))) V(p); // may throw
}
template <typename DisableTrivialInit, typename I, typename P>
inline
-void construct(DisableTrivialInit const&,
- I pos, P const& p)
+void construct(DisableTrivialInit const&, I pos, P const& p)
{
- typedef typename
- ::boost::mpl::and_<
- is_corresponding_value<I, P>,
- ::boost::has_trivial_copy<P>
- >::type
- use_memcpy;
-
- construct_dispatch(pos, p, use_memcpy()); // may throw
+ typedef bcd::bool_
+ < is_corresponding_value<I, P>::value &&
+ bcd::is_trivially_copy_constructible<P>::value
+ > use_memcpy;
+ construct_dispatch(pos, p, use_memcpy()); // may throw
}
// Needed by push_back(V &&)
@@ -564,14 +516,14 @@ template <typename DisableTrivialInit, typename I, typename P>
inline
void construct(DisableTrivialInit const&, I pos, BOOST_RV_REF(P) p)
{
- typedef typename boost::iterator_value<I>::type V;
- new (static_cast<void*>(boost::addressof(*pos))) V(::boost::move(p)); // may throw
+ typedef typename ::boost::container::iterator_traits<I>::value_type V;
+ new (static_cast<void*>(boost::container::container_detail::addressof(*pos))) V(::boost::move(p)); // may throw
}
// Needed by emplace_back() and emplace()
#if !defined(BOOST_CONTAINER_VARRAY_DISABLE_EMPLACE)
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <typename DisableTrivialInit, typename I, class ...Args>
inline
@@ -579,34 +531,28 @@ void construct(DisableTrivialInit const&,
I pos,
BOOST_FWD_REF(Args) ...args)
{
- typedef typename boost::iterator_value<I>::type V;
- new (static_cast<void*>(boost::addressof(*pos))) V(::boost::forward<Args>(args)...); // may throw
+ typedef typename ::boost::container::iterator_traits<I>::value_type V;
+ new (static_cast<void*>(boost::container::container_detail::addressof(*pos))) V(::boost::forward<Args>(args)...); // may throw
}
-#else // !BOOST_NO_VARIADIC_TEMPLATES
+#else // !BOOST_NO_CXX11_VARIADIC_TEMPLATES
// BOOST_NO_RVALUE_REFERENCES -> P0 const& p0
// !BOOST_NO_RVALUE_REFERENCES -> P0 && p0
// which means that version with one parameter may take V const& v
-#define BOOST_PP_LOCAL_MACRO(n) \
-template <typename DisableTrivialInit, typename I, typename P BOOST_PP_ENUM_TRAILING_PARAMS(n, typename P) > \
-inline \
-void construct(DisableTrivialInit const&, \
- I pos, \
- BOOST_CONTAINER_PP_PARAM(P, p) \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
-{ \
- typedef typename boost::iterator_value<I>::type V; \
- new \
- (static_cast<void*>(boost::addressof(*pos))) \
- V(p, BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); /*may throw*/ \
-} \
-//
-#define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
-#include BOOST_PP_LOCAL_ITERATE()
+#define BOOST_CONTAINER_VARRAY_UTIL_CONSTRUCT_CODE(N) \
+template <typename DisableTrivialInit, typename I, typename P BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
+inline void construct(DisableTrivialInit const&, I pos, BOOST_FWD_REF(P) p BOOST_MOVE_I##N BOOST_MOVE_UREF##N )\
+{\
+ typedef typename ::boost::container::iterator_traits<I>::value_type V;\
+ new (static_cast<void*>(boost::container::container_detail::addressof(*pos)))\
+ V(::boost::forward<P>(p) BOOST_MOVE_I##N BOOST_MOVE_FWD##N); /*may throw*/\
+}
+BOOST_MOVE_ITERATE_1TO9(BOOST_CONTAINER_VARRAY_UTIL_CONSTRUCT_CODE)
+#undef BOOST_CONTAINER_VARRAY_UTIL_CONSTRUCT_CODE
-#endif // !BOOST_NO_VARIADIC_TEMPLATES
+#endif // !BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif // !BOOST_CONTAINER_VARRAY_DISABLE_EMPLACE
// assign(I, V)
@@ -614,15 +560,15 @@ void construct(DisableTrivialInit const&,
template <typename I, typename V>
inline
void assign_dispatch(I pos, V const& v,
- boost::mpl::bool_<true> const& /*use_memcpy*/)
+ bcd::true_type const& /*use_memcpy*/)
{
- ::memcpy(boost::addressof(*pos), boost::addressof(v), sizeof(V));
+ ::memcpy(boost::container::container_detail::addressof(*pos), boost::container::container_detail::addressof(v), sizeof(V));
}
template <typename I, typename V>
inline
void assign_dispatch(I pos, V const& v,
- boost::mpl::bool_<false> const& /*use_memcpy*/)
+ bcd::false_type const& /*use_memcpy*/)
{
*pos = v; // may throw
}
@@ -631,14 +577,11 @@ template <typename I, typename V>
inline
void assign(I pos, V const& v)
{
- typedef typename
- ::boost::mpl::and_<
- is_corresponding_value<I, V>,
- ::boost::has_trivial_assign<V>
- >::type
- use_memcpy;
-
- assign_dispatch(pos, v, use_memcpy()); // may throw
+ typedef bcd::bool_
+ < is_corresponding_value<I, V>::value &&
+ bcd::is_trivially_copy_assignable<V>::value
+ > use_memcpy;
+ assign_dispatch(pos, v, use_memcpy()); // may throw
}
template <typename I, typename V>
diff --git a/libs/container/bench/varray.hpp b/libs/container/bench/varray.hpp
index 9840e617a..335c33ffe 100644
--- a/libs/container/bench/varray.hpp
+++ b/libs/container/bench/varray.hpp
@@ -11,7 +11,11 @@
#ifndef BOOST_CONTAINER_VARRAY_HPP
#define BOOST_CONTAINER_VARRAY_HPP
-#if defined(_MSC_VER)
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
diff --git a/libs/container/doc/Jamfile.v2 b/libs/container/doc/Jamfile.v2
index 411851128..c684eaa79 100644
--- a/libs/container/doc/Jamfile.v2
+++ b/libs/container/doc/Jamfile.v2
@@ -29,18 +29,19 @@ doxygen autodoc
\"BOOST_CONTAINER_DOXYGEN_INVOKED\" \\
\"BOOST_CONTAINER_IMPDEF(T)=implementation_defined\" \\
\"BOOST_CONTAINER_SEEDOC(T)=see_documentation\" \\
- \"BOOST_CONTAINER_NOEXCEPT=noexcept\" \\
- \"BOOST_CONTAINER_NOEXCEPT_IF(T)=noexcept(T)\" \\
- \"BOOST_RV_REF(T)=T &&\" \\
+ \"BOOST_NOEXCEPT_OR_NOTHROW=noexcept\" \\
+ \"BOOST_NOEXCEPT_IF(T)=noexcept(T)\" \\
+ \"BOOST_RV_REF(T)=T&&\" \\
\"BOOST_RV_REF_BEG=\" \\
\"BOOST_RV_REF_END=&&\" \\
\"BOOST_COPY_ASSIGN_REF(T)=const T &\" \\
\"BOOST_FWD_REF(a)=a &&\" \\
- \"BOOST_INTRUSIVE_OPTION_CONSTANT(OPTION_NAME, TYPE, VALUE, CONSTANT_NAME) = template<TYPE VALUE> struct OPTION_NAME{};\" \\
- \"BOOST_INTRUSIVE_OPTION_TYPE(OPTION_NAME, TYPE, TYPEDEF_EXPR, TYPEDEF_NAME) = template<class TYPE> struct OPTION_NAME{};\"
+ \"BOOST_INTRUSIVE_OPTION_CONSTANT(OPTION_NAME, TYPE, VALUE, CONSTANT_NAME) = template<TYPE VALUE> struct OPTION_NAME{};\" \\
\"BOOST_CONTAINER_DOC1ST(T1, T2)=T1\" \\
\"BOOST_CONTAINER_DOCIGN(T) \"\\
- \"BOOST_CONTAINER_DOCONLY(T) T\"\\
+ \"BOOST_CONTAINER_DOCONLY(T)=T\"\\
+ \"BOOST_CONTAINER_SCOPEDALLOC_DUMMYTRUE=\"\\
+ \"BOOST_CONTAINER_SCOPEDALLOC_ALLINNER=InnerAllocs...\"\\
"
<xsl:param>"boost.doxygen.reftitle=Boost.Container Header Reference"
;
diff --git a/libs/container/doc/container.qbk b/libs/container/doc/container.qbk
index 7af6a2179..edea3722e 100644
--- a/libs/container/doc/container.qbk
+++ b/libs/container/doc/container.qbk
@@ -514,6 +514,21 @@ are a particular case where `static_vector` can be beneficial.
[endsect]
+[section:small_vector ['small_vector]]
+
+`small_vector` is a vector-like container optimized for the case when it contains few elements.
+It contains some preallocated elements in-place, which allows it to avoid the use of dynamic storage allocation
+when the actual number of elements is below that preallocated threshold. `small_vector` is inspired by
+[@http://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h LLVM's `SmallVector`] container.
+Unlike `static_vector`, `small_vector`'s capacity can grow beyond the initial preallocated capacity.
+
+`small_vector<T, N, Allocator>` is convertible to `small_vector_base<T, Allocator>`, a type that is independent
+from the preallocated element count, allowing client code that does not need to be templated on that N argument.
+`small_vector` inherits all `vector`'s member functions so it supports all standard features like emplacement,
+stateful allocators, etc.
+
+[endsect]
+
[endsect]
[section:extended_functionality Extended functionality]
@@ -596,7 +611,7 @@ used to customize these containers:
In the first C++ standard `list::size()` was not required to be constant-time,
and that caused some controversy in the C++ community. Quoting Howard Hinnant's
-[@http://home.roadrunner.com/~hinnant/On_list_size.html ['On List Size]] paper:
+[@http://howardhinnant.github.io/On_list_size.html ['On List Size]] paper:
[: ['There is a considerable debate on whether `std::list<T>::size()` should be O(1) or O(N).
The usual argument notes that it is a tradeoff with:]
@@ -729,7 +744,7 @@ are movable, requirements for `value_type` are those specified for C++11 contain
For compilers with variadic templates, [*Boost.Container] supports placement insertion
(`emplace`, ...) functions from C++11. For those compilers without variadic templates
support [*Boost.Container] uses the preprocessor to create a set of overloads up to
-a finite (10) number of parameters.
+a finite number of parameters.
[endsect]
@@ -749,7 +764,8 @@ C++11 further improves stateful allocator support through
an allocator writer can customize its behaviour (should the container propagate it in
move constructor, swap, etc.?) following `allocator_traits` requirements. [*Boost.Container]
not only supports this model with C++11 but also [*backports it to C++03] via
-[classref boost::container::allocator_traits boost::container::allocator_traits]. This class
+[classref boost::container::allocator_traits boost::container::allocator_traits] including some
+C++17 changes. This class
offers some workarounds for C++03 compilers to achieve the same allocator guarantees as
`std::allocator_traits`.
@@ -777,7 +793,8 @@ is the outer allocator for use by the container, the second allocator is passed
container's elements, and, if the elements themselves are containers, the third allocator is passed to the
elements' elements, and so on.
-[*Boost.Container] implements its own `scoped_allocator_adaptor` class and [*backports this feature also
+[*Boost.Container] implements its own [classref boost::container::scoped_allocator_adaptor scoped_allocator_adaptor]
+class and [*backports this feature also
to C++03 compilers]. Due to C++03 limitations, in those compilers
the allocator propagation implemented by `scoped_allocator_adaptor::construct` functions
will be based on traits ([classref boost::container::constructible_with_allocator_suffix constructible_with_allocator_suffix]
@@ -791,12 +808,12 @@ will be used to detect if the allocator must be propagated with suffix or prefix
[endsect]
-[section:insertion_hints Insertion hints in associative containers and preserving
+[section:insertion_hints Insertion hints in associative containers and preserving
insertion ordering for elements with equivalent keys]
[@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#233 LWG Issue #233] corrected a defect
in C++98 and specified how equivalent keys were to be inserted in associative containers. [*Boost.Container]
-implements the C++11 changes that were specified in [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html N1780
+implements the C++11 changes that were specified in [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html N1780
['Comments on LWG issue 233: Insertion hints in associative containers]]:
* `a_eq.insert(t)`: If a range containing elements equivalent to t exists in a_eq, t is inserted at the end of that range.
@@ -883,7 +900,7 @@ to detect a reference to an inserted element and an additional copy in that case
references to already inserted objects are not used. Note that equivalent functions taking rvalue references or
iterator ranges require elements not already inserted in the container.
-[*Boost.Container] prioritizes performance and has not implemented the NAD resolution:
+[*Boost.Container] prioritizes performance and has not implemented the NAD resolution:
in functions that might modify the argument, the library requires references to elements not stored
in the container. Using references to inserted elements yields to undefined behaviour (although in debug mode, this
precondition violation could be notified via BOOST_ASSERT).
@@ -897,7 +914,7 @@ unsuccessful tries to deprecate or remove it from the standard. [*Boost.Containe
as there is a superior [@http://www.boost.org/libs/dynamic_bitset/ Boost.DynamicBitset]
solution. For issues with `vector<bool>` see the following papers:
-* [@http://home.roadrunner.com/~hinnant/onvectorbool.html On `vector<bool>`]
+* [@http://howardhinnant.github.io/onvectorbool.html On `vector<bool>`]
* [@http://www.gotw.ca/publications/N1211.pdf vector<bool>: N1211: More Problems, Better Solutions],
* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2160.html N2160: Library Issue 96: Fixing vector<bool>],
* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2204.html N2204 A Specification to deprecate vector<bool>].
@@ -946,7 +963,7 @@ member object and member function pointers) to be initializable using `std::mems
Most platforms are compatible with this initialization, but in case this initialization is not desired the
user can `#define BOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_ZERO` before including library headers.
-If neither `BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_NOT_ZERO` nor
+If neither `BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_NOT_ZERO` nor
`BOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_ZERO` is defined [*Boost.Container] also considers POD
types to be value initializable via `std::memset` with value zero.
@@ -1079,6 +1096,28 @@ use [*Boost.Container]? There are several reasons for that:
[section:release_notes Release Notes]
+[section:release_notes_boost_1_58_00 Boost 1.58 Release]
+* Experimental [classref boost::container::small_vector small_vector] container.
+* Massive dependency reorganization. Now [*Boost.Container] depends on very basic utilities like Boost.Core
+ and [*Boost.Intrusive]. Preprocessed code size have decreased considerably and compilation times have improved.
+* Added `nth` and `index_of` functions to containers with random-access iterators (except `basic_string`).
+* Added C++17's `allocator_traits<Allocator>::is_always_equal`.
+* Updated containers to implement new constructors as specified in
+ [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2210 2210. Missing allocator-extended constructor for allocator-aware containers].
+* Fixed bugs:
+ * [@https://svn.boost.org/trac/boost/ticket/9931 #9931: ['"flat_map::insert(ordered_unique_range_t...) fails with move_iterators"]] (reopened).
+ * [@https://svn.boost.org/trac/boost/ticket/11076 #11076: ['"Unqualified calls to memmove/memcpy in container/detail/copy_move_algo.hpp"]].
+ * [@https://svn.boost.org/trac/boost/ticket/10790 Trac #10790 (['long long errors from container"])].
+ * [@https://svn.boost.org/trac/boost/ticket/10808 Trac #10808 (['compare equal operator of vector is broken"])].
+* [*Source Breaking]: [classref boost::container::scoped_allocator_adaptor scoped_allocator_adaptor]'s
+ `propagate_on_container_copy_assignment`, `propagate_on_container_move_assignment` and `propagate_on_container_swap`
+ are no longer `::boost::integral_constant<bool, true/false>` types. The dependency reorganization needed to break
+ with those classes to avoid MPL dependencies, and interoperability with `std::integral_constant` was not guaranteed.
+ Code assumming `boost::true_type/boost::false_type` on this will not compile. As a workaround, use the guaranteed internal
+ `::value` constant: `::boost::integral_constant<bool, scoped_allocator_adaptor<Allocator>::propagate_on_container_move_assignment::value>`.
+
+[endsect]
+
[section:release_notes_boost_1_57_00 Boost 1.57 Release]
* Added support for `initializer_list`. Contributed by Robert Matusewicz.
* Fixed double destruction bugs in vector and backward expansion capable allocators.
diff --git a/libs/container/proj/vc7ide/alloc_lib.vcproj b/libs/container/proj/vc7ide/alloc_lib.vcproj
index 497a4b8bb..eec4f594b 100644
--- a/libs/container/proj/vc7ide/alloc_lib.vcproj
+++ b/libs/container/proj/vc7ide/alloc_lib.vcproj
@@ -107,76 +107,39 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <File
- RelativePath="..\..\..\..\boost\container\adaptive_pool.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\allocator.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\node_allocator.hpp">
- </File>
<Filter
- Name="detail"
+ Name="Included Sources"
Filter="">
<File
- RelativePath="..\..\..\..\boost\container\detail\adaptive_node_pool.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\alloc_lib.h">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\alloc_lib_auto_link.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\auto_link.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\mutex.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\node_pool.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\pool_common_alloc.hpp">
+ RelativePath="..\..\src\dlmalloc_2_8_6.c">
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="TRUE">
+ <Tool
+ Name="VCCLCompilerTool"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="TRUE">
+ <Tool
+ Name="VCCLCompilerTool"/>
+ </FileConfiguration>
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\singleton.hpp">
+ RelativePath="..\..\src\dlmalloc_ext_2_8_6.c">
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="TRUE">
+ <Tool
+ Name="VCCLCompilerTool"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="TRUE">
+ <Tool
+ Name="VCCLCompilerTool"/>
+ </FileConfiguration>
</File>
- <Filter
- Name="Included Sources"
- Filter="">
- <File
- RelativePath="..\..\src\dlmalloc_2_8_6.c">
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\src\dlmalloc_ext_2_8_6.c">
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="TRUE">
- <Tool
- Name="VCCLCompilerTool"/>
- </FileConfiguration>
- </File>
- </Filter>
</Filter>
</Filter>
<Filter
diff --git a/libs/container/proj/vc7ide/allocator_traits_test.vcproj b/libs/container/proj/vc7ide/allocator_traits_test.vcproj
index 1091006b9..fda5d8653 100644
--- a/libs/container/proj/vc7ide/allocator_traits_test.vcproj
+++ b/libs/container/proj/vc7ide/allocator_traits_test.vcproj
@@ -1,135 +1,135 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="allocator_traits_test"
- ProjectGUID="{5CE11C83-096A-84FE-4FA2-D3A6BA792002}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../Bin/Win32/Debug"
- IntermediateDirectory="Debug/allocator_traits_test"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- GeneratePreprocessedFile="0"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/allocator_traits_test_d.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../stage/lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/allocator_traits_test.pdb"
- SubSystem="1"
- TargetMachine="1"
- FixedBaseAddress="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../Bin/Win32/Release"
- IntermediateDirectory="Release/allocator_traits_test"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- TreatWChar_tAsBuiltInType="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/allocator_traits_test.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../stage/lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="allocator_traits_test"
+ ProjectGUID="{5CE11C83-096A-84FE-4FA2-D3A6BA792002}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/allocator_traits_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/allocator_traits_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/allocator_traits_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
FixedBaseAddress="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{41737BCF-4312-7AC5-A066-32D75A32A2AF}">
- <File
- RelativePath="..\..\test\allocator_traits_test.cpp">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/allocator_traits_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/allocator_traits_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{41737BCF-4312-7AC5-A066-32D75A32A2AF}">
+ <File
+ RelativePath="..\..\test\allocator_traits_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/container.sln b/libs/container/proj/vc7ide/container.sln
index a4489cb20..0fe3e9ada 100644
--- a/libs/container/proj/vc7ide/container.sln
+++ b/libs/container/proj/vc7ide/container.sln
@@ -175,6 +175,54 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "null_iterators_test", "null
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_vector_test", "explicit_inst_vector_test.vcproj", "{CA85EE11-096A-4F8A-4FA2-92DA72020000}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_list_test", "explicit_inst_list_test.vcproj", "{CE1A85E0-096A-42FC-F83A-97A242002DA5}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_deque_test", "explicit_inst_deque_test.vcproj", "{CEE1A855-096A-3AC8-2F5C-9DA2420523A5}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_slist_test", "explicit_inst_slist_test.vcproj", "{CE1A8F65-AC48-096A-2F5C-7A2420D323A1}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_stable_vector_test", "explicit_inst_stable_vector_test.vcproj", "{AC285EA1-F8A3-306C-4FA2-A02029D5E720}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_static_vector_test", "explicit_inst_static_vector_test.vcproj", "{E287ACA1-FA42-3F7A-06C2-AC72012209F5}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_string_test", "explicit_inst_string_test.vcproj", "{6A85ECE0-A596-24EA-F83A-9231D72A0217}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_set_test", "explicit_inst_set_test.vcproj", "{C11D9E85-16A9-4A2E-C4F6-92F7E138200D}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_map_test", "explicit_inst_map_test.vcproj", "{CD9E8655-94A3-6C2E-C4F6-97E1382073FC}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_flat_map_test", "explicit_inst_flat_map_test.vcproj", "{9845ECE5-C27E-4F6C-94A3-9C2E1E7231FC}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "explicit_inst_flat_set_test", "explicit_inst_flat_set_test.vcproj", "{C811D9F8-A27E-1A91-FC44-92F14F73820B}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "small_vector_test", "small_vector_test.vcproj", "{5CE8E110-096A-84FE-4A2A-BA7E925A6002}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -357,6 +405,54 @@ Global
{C90520E3-B8A9-EB54-76E2-25DFA3C7762A}.Debug.Build.0 = Debug|Win32
{C90520E3-B8A9-EB54-76E2-25DFA3C7762A}.Release.ActiveCfg = Release|Win32
{C90520E3-B8A9-EB54-76E2-25DFA3C7762A}.Release.Build.0 = Release|Win32
+ {CA85EE11-096A-4F8A-4FA2-92DA72020000}.Debug.ActiveCfg = Debug|Win32
+ {CA85EE11-096A-4F8A-4FA2-92DA72020000}.Debug.Build.0 = Debug|Win32
+ {CA85EE11-096A-4F8A-4FA2-92DA72020000}.Release.ActiveCfg = Release|Win32
+ {CA85EE11-096A-4F8A-4FA2-92DA72020000}.Release.Build.0 = Release|Win32
+ {CE1A85E0-096A-42FC-F83A-97A242002DA5}.Debug.ActiveCfg = Debug|Win32
+ {CE1A85E0-096A-42FC-F83A-97A242002DA5}.Debug.Build.0 = Debug|Win32
+ {CE1A85E0-096A-42FC-F83A-97A242002DA5}.Release.ActiveCfg = Release|Win32
+ {CE1A85E0-096A-42FC-F83A-97A242002DA5}.Release.Build.0 = Release|Win32
+ {CEE1A855-096A-3AC8-2F5C-9DA2420523A5}.Debug.ActiveCfg = Debug|Win32
+ {CEE1A855-096A-3AC8-2F5C-9DA2420523A5}.Debug.Build.0 = Debug|Win32
+ {CEE1A855-096A-3AC8-2F5C-9DA2420523A5}.Release.ActiveCfg = Release|Win32
+ {CEE1A855-096A-3AC8-2F5C-9DA2420523A5}.Release.Build.0 = Release|Win32
+ {CE1A8F65-AC48-096A-2F5C-7A2420D323A1}.Debug.ActiveCfg = Debug|Win32
+ {CE1A8F65-AC48-096A-2F5C-7A2420D323A1}.Debug.Build.0 = Debug|Win32
+ {CE1A8F65-AC48-096A-2F5C-7A2420D323A1}.Release.ActiveCfg = Release|Win32
+ {CE1A8F65-AC48-096A-2F5C-7A2420D323A1}.Release.Build.0 = Release|Win32
+ {AC285EA1-F8A3-306C-4FA2-A02029D5E720}.Debug.ActiveCfg = Debug|Win32
+ {AC285EA1-F8A3-306C-4FA2-A02029D5E720}.Debug.Build.0 = Debug|Win32
+ {AC285EA1-F8A3-306C-4FA2-A02029D5E720}.Release.ActiveCfg = Release|Win32
+ {AC285EA1-F8A3-306C-4FA2-A02029D5E720}.Release.Build.0 = Release|Win32
+ {E287ACA1-FA42-3F7A-06C2-AC72012209F5}.Debug.ActiveCfg = Debug|Win32
+ {E287ACA1-FA42-3F7A-06C2-AC72012209F5}.Debug.Build.0 = Debug|Win32
+ {E287ACA1-FA42-3F7A-06C2-AC72012209F5}.Release.ActiveCfg = Release|Win32
+ {E287ACA1-FA42-3F7A-06C2-AC72012209F5}.Release.Build.0 = Release|Win32
+ {6A85ECE0-A596-24EA-F83A-9231D72A0217}.Debug.ActiveCfg = Debug|Win32
+ {6A85ECE0-A596-24EA-F83A-9231D72A0217}.Debug.Build.0 = Debug|Win32
+ {6A85ECE0-A596-24EA-F83A-9231D72A0217}.Release.ActiveCfg = Release|Win32
+ {6A85ECE0-A596-24EA-F83A-9231D72A0217}.Release.Build.0 = Release|Win32
+ {C11D9E85-16A9-4A2E-C4F6-92F7E138200D}.Debug.ActiveCfg = Debug|Win32
+ {C11D9E85-16A9-4A2E-C4F6-92F7E138200D}.Debug.Build.0 = Debug|Win32
+ {C11D9E85-16A9-4A2E-C4F6-92F7E138200D}.Release.ActiveCfg = Release|Win32
+ {C11D9E85-16A9-4A2E-C4F6-92F7E138200D}.Release.Build.0 = Release|Win32
+ {CD9E8655-94A3-6C2E-C4F6-97E1382073FC}.Debug.ActiveCfg = Debug|Win32
+ {CD9E8655-94A3-6C2E-C4F6-97E1382073FC}.Debug.Build.0 = Debug|Win32
+ {CD9E8655-94A3-6C2E-C4F6-97E1382073FC}.Release.ActiveCfg = Release|Win32
+ {CD9E8655-94A3-6C2E-C4F6-97E1382073FC}.Release.Build.0 = Release|Win32
+ {9845ECE5-C27E-4F6C-94A3-9C2E1E7231FC}.Debug.ActiveCfg = Debug|Win32
+ {9845ECE5-C27E-4F6C-94A3-9C2E1E7231FC}.Debug.Build.0 = Debug|Win32
+ {9845ECE5-C27E-4F6C-94A3-9C2E1E7231FC}.Release.ActiveCfg = Release|Win32
+ {9845ECE5-C27E-4F6C-94A3-9C2E1E7231FC}.Release.Build.0 = Release|Win32
+ {C811D9F8-A27E-1A91-FC44-92F14F73820B}.Debug.ActiveCfg = Debug|Win32
+ {C811D9F8-A27E-1A91-FC44-92F14F73820B}.Debug.Build.0 = Debug|Win32
+ {C811D9F8-A27E-1A91-FC44-92F14F73820B}.Release.ActiveCfg = Release|Win32
+ {C811D9F8-A27E-1A91-FC44-92F14F73820B}.Release.Build.0 = Release|Win32
+ {5CE8E110-096A-84FE-4A2A-BA7E925A6002}.Debug.ActiveCfg = Debug|Win32
+ {5CE8E110-096A-84FE-4A2A-BA7E925A6002}.Debug.Build.0 = Debug|Win32
+ {5CE8E110-096A-84FE-4A2A-BA7E925A6002}.Release.ActiveCfg = Release|Win32
+ {5CE8E110-096A-84FE-4A2A-BA7E925A6002}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
diff --git a/libs/container/proj/vc7ide/container.vcproj b/libs/container/proj/vc7ide/container.vcproj
index 291c603b4..035bcc0a0 100644
--- a/libs/container/proj/vc7ide/container.vcproj
+++ b/libs/container/proj/vc7ide/container.vcproj
@@ -126,6 +126,9 @@
RelativePath="..\..\..\..\boost\container\map.hpp">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\new_allocator.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\node_allocator.hpp">
</File>
<File
@@ -144,6 +147,9 @@
RelativePath="..\..\..\..\boost\container\slist.hpp">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\small_vector.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\stable_vector.hpp">
</File>
<File
@@ -171,15 +177,24 @@
RelativePath="..\..\..\..\boost\container\detail\adaptive_node_pool_impl.hpp">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\detail\addressof.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\detail\advanced_insert_int.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\algorithms.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\algorithm.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\alloc_helpers.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\alloc_lib.h">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\detail\alloc_lib_auto_link.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\detail\allocation_type.hpp">
</File>
<File
@@ -189,7 +204,7 @@
RelativePath="..\..\..\..\boost\container\detail\auto_link.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\boost_cont_ext_auto_link.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\compare_functors.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\config_begin.hpp">
@@ -198,6 +213,12 @@
RelativePath="..\..\..\..\boost\container\detail\config_end.hpp">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\detail\construct_in_place.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\copy_move_algo.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\detail\destroyers.hpp">
</File>
<File
@@ -210,7 +231,10 @@
RelativePath="..\..\..\..\boost\container\detail\hash_table.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\iterator_traits.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\iterator.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\iterator_to_raw_pointer.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\iterators.hpp">
@@ -219,7 +243,10 @@
RelativePath="..\..\..\..\boost\container\detail\math_functions.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\memory_util.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\min_max.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\minimal_char_traits_header.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\mpl.hpp">
@@ -231,6 +258,9 @@
RelativePath="..\..\..\..\boost\container\detail\mutex.hpp">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\detail\next_capacity.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\detail\node_alloc_holder.hpp">
</File>
<File
@@ -243,16 +273,13 @@
RelativePath="..\..\..\..\boost\container\detail\pair.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\pool_common.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\placement_new.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\pool_common_alloc.hpp">
- </File>
- <File
- RelativePath="..\..\..\..\boost\container\detail\preprocessor.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\pool_common.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\reverse_iterator.hpp">
+ RelativePath="..\..\..\..\boost\container\detail\pool_common_alloc.hpp">
</File>
<File
RelativePath="..\..\..\..\boost\container\detail\singleton.hpp">
@@ -261,6 +288,9 @@
RelativePath="..\..\..\..\boost\container\detail\std_fwd.hpp">
</File>
<File
+ RelativePath="..\..\..\..\boost\container\detail\to_raw_pointer.hpp">
+ </File>
+ <File
RelativePath="..\..\..\..\boost\container\detail\transform_iterator.hpp">
</File>
<File
@@ -270,9 +300,6 @@
RelativePath="..\..\..\..\boost\container\detail\type_traits.hpp">
</File>
<File
- RelativePath="..\..\..\..\boost\container\detail\utilities.hpp">
- </File>
- <File
RelativePath="..\..\..\..\boost\container\detail\value_init.hpp">
</File>
<File
@@ -343,7 +370,10 @@
RelativePath="..\..\test\forward_to_input_iterator.hpp">
</File>
<File
- RelativePath="..\..\test\heap_allocator_v1.hpp">
+ RelativePath="..\..\test\heap_version_1.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\input_from_forward_iterator.hpp">
</File>
<File
RelativePath="..\..\test\insert_test.hpp">
@@ -375,6 +405,9 @@
<File
RelativePath="..\..\test\util.hpp">
</File>
+ <File
+ RelativePath="..\..\test\vector_test.hpp">
+ </File>
</Filter>
<Filter
Name="bench"
diff --git a/libs/container/proj/vc7ide/explicit_inst_deque_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_deque_test.vcproj
new file mode 100644
index 000000000..e1e44d9ad
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_deque_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_deque_test"
+ ProjectGUID="{CEE1A855-096A-3AC8-2F5C-9DA2420523A5}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_deque_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_deque_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_deque_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_deque_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_deque_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4AD1782B-1773-3A20-6A36-C2A3C50F30AF}">
+ <File
+ RelativePath="..\..\test\explicit_inst_deque_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_flat_map_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_flat_map_test.vcproj
new file mode 100644
index 000000000..a390cefa7
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_flat_map_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_flat_map_test"
+ ProjectGUID="{9845ECE5-C27E-4F6C-94A3-9C2E1E7231FC}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_flat_map_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_flat_map_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_flat_map_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_flat_map_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_flat_map_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC7591E-8315-366C-AC10-5A2733272AF2}">
+ <File
+ RelativePath="..\..\test\explicit_inst_flat_map_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_flat_set_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_flat_set_test.vcproj
new file mode 100644
index 000000000..2af4b870e
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_flat_set_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_flat_set_test"
+ ProjectGUID="{C811D9F8-A27E-1A91-FC44-92F14F73820B}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_flat_set_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_flat_set_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_flat_set_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_flat_set_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_flat_set_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4A733BDE-1562-C14A-A365-272AC26DA39C}">
+ <File
+ RelativePath="..\..\test\explicit_inst_flat_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_list_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_list_test.vcproj
new file mode 100644
index 000000000..4d24787c6
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_list_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_list_test"
+ ProjectGUID="{CE1A85E0-096A-42FC-F83A-97A242002DA5}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_list_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_list_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_list_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_list_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_list_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{47AD178B-7631-20AC-6A36-C22A30AA3C5F}">
+ <File
+ RelativePath="..\..\test\explicit_inst_list_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_map_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_map_test.vcproj
new file mode 100644
index 000000000..8da1429f3
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_map_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_map_test"
+ ProjectGUID="{CD9E8655-94A3-6C2E-C4F6-97E1382073FC}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_map_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_map_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_map_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_map_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_map_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC7591E-8315-366C-AC10-5A2733272AF2}">
+ <File
+ RelativePath="..\..\test\explicit_inst_map_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_set_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_set_test.vcproj
new file mode 100644
index 000000000..e61403a6a
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_set_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_set_test"
+ ProjectGUID="{C11D9E85-16A9-4A2E-C4F6-92F7E138200D}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_set_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_set_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_set_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_set_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_set_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4CD1733E-3156-AC10-6A36-5A33A272AC2C}">
+ <File
+ RelativePath="..\..\test\explicit_inst_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_slist_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_slist_test.vcproj
new file mode 100644
index 000000000..33f1d3cab
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_slist_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_slist_test"
+ ProjectGUID="{CE1A8F65-AC48-096A-2F5C-7A2420D323A1}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_slist_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_slist_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_slist_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_slist_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_slist_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4178CF2B-1773-6A36-31A2-CF300C0AA17F}">
+ <File
+ RelativePath="..\..\test\explicit_inst_slist_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_stable_vector_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_stable_vector_test.vcproj
new file mode 100644
index 000000000..2227f5a59
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_stable_vector_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_stable_vector_test"
+ ProjectGUID="{AC285EA1-F8A3-306C-4FA2-A02029D5E720}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_stable_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_stable_vector_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_stable_vector_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_stable_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_stable_vector_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4D1737BD-7315-6A76-25AC-A22ACF222A31}">
+ <File
+ RelativePath="..\..\test\explicit_inst_stable_vector_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_static_vector_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_static_vector_test.vcproj
new file mode 100644
index 000000000..6b5760394
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_static_vector_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_static_vector_test"
+ ProjectGUID="{E287ACA1-FA42-3F7A-06C2-AC72012209F5}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_static_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_static_vector_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_static_vector_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_static_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_static_vector_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{430BDB17-7539-28AC-A736-C1AC2F222A31}">
+ <File
+ RelativePath="..\..\test\explicit_inst_static_vector_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_string_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_string_test.vcproj
new file mode 100644
index 000000000..46031afe5
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_string_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_string_test"
+ ProjectGUID="{6A85ECE0-A596-24EA-F83A-9231D72A0217}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_string_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_string_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_string_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_string_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_string_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{737D4D9B-3763-AC29-6A36-3622F02A5EBF}">
+ <File
+ RelativePath="..\..\test\explicit_inst_string_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/explicit_inst_vector_test.vcproj b/libs/container/proj/vc7ide/explicit_inst_vector_test.vcproj
new file mode 100644
index 000000000..236b032c2
--- /dev/null
+++ b/libs/container/proj/vc7ide/explicit_inst_vector_test.vcproj
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="explicit_inst_vector_test"
+ ProjectGUID="{CA85EE11-096A-4F8A-4FA2-92DA72020000}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/explicit_inst_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_vector_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/explicit_inst_vector_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/explicit_inst_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/explicit_inst_vector_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4CD1737B-2AC2-7315-6A36-3A225A322AAF}">
+ <File
+ RelativePath="..\..\test\explicit_inst_vector_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/list_test.vcproj b/libs/container/proj/vc7ide/list_test.vcproj
index 3ebaf1b22..1aec531c8 100644
--- a/libs/container/proj/vc7ide/list_test.vcproj
+++ b/libs/container/proj/vc7ide/list_test.vcproj
@@ -21,7 +21,6 @@
Optimization="0"
AdditionalIncludeDirectories="../../../.."
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- GeneratePreprocessedFile="0"
KeepComments="FALSE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
diff --git a/libs/container/proj/vc7ide/scoped_allocator_adaptor.vcproj b/libs/container/proj/vc7ide/scoped_allocator_adaptor.vcproj
index 451d6dd21..e3ad785df 100644
--- a/libs/container/proj/vc7ide/scoped_allocator_adaptor.vcproj
+++ b/libs/container/proj/vc7ide/scoped_allocator_adaptor.vcproj
@@ -1,136 +1,134 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="scoped_allocator_adaptor_test"
- ProjectGUID="{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../Bin/Win32/Debug"
- IntermediateDirectory="Debug/scoped_allocator_adaptor_test"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- GeneratePreprocessedFile="0"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/scoped_allocator_adaptor_test_d.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../stage/lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/scoped_allocator_adaptor_test.pdb"
- SubSystem="1"
- TargetMachine="1"
- FixedBaseAddress="1"
- />
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../Bin/Win32/Release"
- IntermediateDirectory="Release/scoped_allocator_adaptor_test"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- TreatWChar_tAsBuiltInType="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/scoped_allocator_adaptor_test.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../stage/lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="scoped_allocator_adaptor_test"
+ ProjectGUID="{B4E9FB12-7D7C-4461-83A9-5EB2C78E608F}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/scoped_allocator_adaptor_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/scoped_allocator_adaptor_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/scoped_allocator_adaptor_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
FixedBaseAddress="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{41737BCF-4312-7AC5-A066-32D75A32A2AF}">
- <File
- RelativePath="..\..\test\scoped_allocator_adaptor_test.cpp">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/scoped_allocator_adaptor_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/scoped_allocator_adaptor_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{41737BCF-4312-7AC5-A066-32D75A32A2AF}">
+ <File
+ RelativePath="..\..\test\scoped_allocator_adaptor_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/small_vector_test.vcproj b/libs/container/proj/vc7ide/small_vector_test.vcproj
new file mode 100644
index 000000000..7cb564050
--- /dev/null
+++ b/libs/container/proj/vc7ide/small_vector_test.vcproj
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="small_vector_test"
+ ProjectGUID="{5CE8E110-096A-84FE-4A2A-BA7E925A6002}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/small_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/small_vector_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/small_vector_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/small_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/small_vector_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4737BC0F-1242-A066-7AC5-32A2D715B4AF}">
+ <File
+ RelativePath="..\..\test\small_vector_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libs/container/proj/vc7ide/throw_exception_test.vcproj b/libs/container/proj/vc7ide/throw_exception_test.vcproj
index 88d3de3f7..8522325ce 100644
--- a/libs/container/proj/vc7ide/throw_exception_test.vcproj
+++ b/libs/container/proj/vc7ide/throw_exception_test.vcproj
@@ -1,136 +1,136 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="throw_exception_test"
- ProjectGUID="{5A8D91E0-FA57-284F-84FE-D3A6BA792002}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../Bin/Win32/Debug"
- IntermediateDirectory="Debug/throw_exception_test"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- ExceptionHandling="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/throw_exception_test_d.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../stage/lib"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/throw_exception_test.pdb"
- SubSystem="1"
- TargetMachine="1"
- FixedBaseAddress="1"
- />
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../Bin/Win32/Release"
- IntermediateDirectory="Release/throw_exception_test"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- TreatWChar_tAsBuiltInType="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/throw_exception_test.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="../../../../stage/lib"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="throw_exception_test"
+ ProjectGUID="{5A8D91E0-FA57-284F-84FE-D3A6BA792002}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/throw_exception_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/throw_exception_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/throw_exception_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
FixedBaseAddress="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{A1735C4B-7AC5-3542-C626-3A2AF6C0D762}">
- <File
- RelativePath="..\..\test\throw_exception_test.cpp">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/throw_exception_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/throw_exception_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{A1735C4B-7AC5-3542-C626-3A2AF6C0D762}">
+ <File
+ RelativePath="..\..\test\throw_exception_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
</VisualStudioProject>
diff --git a/libs/container/test/alloc_full_test.cpp b/libs/container/test/alloc_full_test.cpp
index a2835523b..1ffc2a9d9 100644
--- a/libs/container/test/alloc_full_test.cpp
+++ b/libs/container/test/alloc_full_test.cpp
@@ -15,7 +15,6 @@
#include <vector>
#include <iostream>
-#include <utility>
#include <cstring>
#include <algorithm> //std::remove
#include <boost/container/detail/alloc_lib_auto_link.hpp>
diff --git a/libs/container/test/allocator_traits_test.cpp b/libs/container/test/allocator_traits_test.cpp
index 407a62b49..3f4dff0c8 100644
--- a/libs/container/test/allocator_traits_test.cpp
+++ b/libs/container/test/allocator_traits_test.cpp
@@ -11,18 +11,25 @@
#include <cstddef>
#include <boost/container/allocator_traits.hpp>
#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/integral_constant.hpp>
+#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/function_detector.hpp>
#include <boost/move/utility_core.hpp>
#include <memory>
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+#include <boost/move/detail/fwd_macros.hpp>
+#endif
+#include <boost/core/lightweight_test.hpp>
template<class T>
class SimpleAllocator
{
+ public:
bool allocate_called_;
bool deallocate_called_;
- public:
+
+ typedef boost::container::container_detail::
+ true_type is_always_equal;
+
typedef T value_type;
template <class U>
@@ -47,15 +54,26 @@ class SimpleAllocator
bool deallocate_called() const
{ return deallocate_called_; }
+
+ friend bool operator==(const SimpleAllocator &, const SimpleAllocator &)
+ { return true; }
+
+ friend bool operator!=(const SimpleAllocator &, const SimpleAllocator &)
+ { return false; }
};
template<class T>
class SimpleSmartPtr
{
+ void unspecified_bool_type_func() const {}
+ typedef void (SimpleSmartPtr::*unspecified_bool_type)() const;
+
public:
- SimpleSmartPtr()
- : ptr_(0)
+ typedef T* pointer;
+
+ explicit SimpleSmartPtr(pointer p = 0)
+ : ptr_(p)
{}
SimpleSmartPtr(const SimpleSmartPtr &c)
@@ -64,7 +82,8 @@ class SimpleSmartPtr
SimpleSmartPtr & operator=(const SimpleSmartPtr &c)
{ this->ptr_ = c.ptr_; }
- typedef T* pointer;
+ operator unspecified_bool_type() const
+ { return ptr_? &SimpleSmartPtr::unspecified_bool_type_func : 0; }
private:
T *ptr_;
@@ -73,6 +92,7 @@ class SimpleSmartPtr
template<class T>
class ComplexAllocator
{
+ public:
bool allocate_called_;
bool deallocate_called_;
bool allocate_hint_called_;
@@ -80,8 +100,8 @@ class ComplexAllocator
mutable bool max_size_called_;
mutable bool select_on_container_copy_construction_called_;
bool construct_called_;
+ mutable bool storage_is_unpropagable_;
- public:
typedef T value_type;
typedef SimpleSmartPtr<T> pointer;
typedef SimpleSmartPtr<const T> const_pointer;
@@ -93,9 +113,14 @@ class ComplexAllocator
typedef SimpleSmartPtr<const void> const_void_pointer;
typedef signed short difference_type;
typedef unsigned short size_type;
- typedef boost::true_type propagate_on_container_copy_assignment;
- typedef boost::true_type propagate_on_container_move_assignment;
- typedef boost::true_type propagate_on_container_swap;
+ typedef boost::container::container_detail::
+ true_type propagate_on_container_copy_assignment;
+ typedef boost::container::container_detail::
+ true_type propagate_on_container_move_assignment;
+ typedef boost::container::container_detail::
+ true_type propagate_on_container_swap;
+ typedef boost::container::container_detail::
+ true_type is_partially_propagable;
ComplexAllocator()
: allocate_called_(false)
@@ -127,23 +152,30 @@ class ComplexAllocator
size_type max_size() const
{ max_size_called_ = true; return size_type(size_type(0)-1); }
- #define BOOST_PP_LOCAL_MACRO(n) \
- template<class U BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
- void construct(U *p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- { \
- construct_called_ = true; \
- ::new (p) U (BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
- } \
+ #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
+ #define BOOST_CONTAINER_COMPLEXALLOCATOR_CONSTRUCT_IMPL(N)\
+ \
+ template< class U BOOST_MOVE_I##N BOOST_MOVE_CLASS##N > \
+ void construct(U *p BOOST_MOVE_I##N BOOST_MOVE_UREF##N) \
+ { construct_called_ = true; ::new(p) U ( BOOST_MOVE_FWD##N ); }\
//
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
+ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_COMPLEXALLOCATOR_CONSTRUCT_IMPL)
+ #undef BOOST_CONTAINER_COMPLEXALLOCATOR_CONSTRUCT_IMPL
+ #else
+
+ template< class U, class ...Args>
+ void construct(U *p, BOOST_FWD_REF(Args) ...args)
+ { construct_called_ = true; ::new(p) U( ::boost::forward<Args>(args)...); }
+
+ #endif
template<class U>
void construct(U *p, boost::container::default_init_t)
- {
- construct_called_ = true;
- ::new (p) U;
- }
+ { construct_called_ = true; ::new(p)U; }
+
+ bool storage_is_unpropagable(pointer p) const
+ { storage_is_unpropagable_ = true; return !p; }
//getters
bool allocate_called() const
@@ -166,6 +198,9 @@ class ComplexAllocator
bool construct_called() const
{ return construct_called_; }
+
+ bool storage_is_unpropagable_called() const
+ { return storage_is_unpropagable_; }
};
class copymovable
@@ -212,22 +247,23 @@ void test_void_allocator()
int main()
{
+ using namespace boost::container::container_detail;
test_void_allocator();
//SimpleAllocator
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::value_type, int>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::pointer, int*>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::const_pointer, const int*>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::void_pointer, void*>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::const_void_pointer, const void*>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::difference_type, std::ptrdiff_t>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::size_type, std::size_t>::value ));
BOOST_STATIC_ASSERT(( boost::container::allocator_traits
< SimpleAllocator<int> >::propagate_on_container_copy_assignment::value == false ));
@@ -235,27 +271,31 @@ int main()
< SimpleAllocator<int> >::propagate_on_container_move_assignment::value == false ));
BOOST_STATIC_ASSERT(( boost::container::allocator_traits
< SimpleAllocator<int> >::propagate_on_container_swap::value == false ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( boost::container::allocator_traits
+ < SimpleAllocator<int> >::is_always_equal::value == true ));
+ BOOST_STATIC_ASSERT(( boost::container::allocator_traits
+ < SimpleAllocator<int> >::is_partially_propagable::value == false ));
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::rebind_traits<double>::allocator_type
, SimpleAllocator<double> >::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< SimpleAllocator<int> >::rebind_alloc<double>::value_type
, double >::value ));
//ComplexAllocator
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::value_type, int>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::pointer, SimpleSmartPtr<int> >::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::const_pointer, SimpleSmartPtr<const int> >::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::void_pointer, SimpleSmartPtr<void> >::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::const_void_pointer, SimpleSmartPtr<const void> >::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::difference_type, signed short>::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::size_type, unsigned short>::value ));
BOOST_STATIC_ASSERT(( boost::container::allocator_traits
< ComplexAllocator<int> >::propagate_on_container_copy_assignment::value == true ));
@@ -263,10 +303,14 @@ int main()
< ComplexAllocator<int> >::propagate_on_container_move_assignment::value == true ));
BOOST_STATIC_ASSERT(( boost::container::allocator_traits
< ComplexAllocator<int> >::propagate_on_container_swap::value == true ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( boost::container::allocator_traits
+ < ComplexAllocator<int> >::is_always_equal::value == false ));
+ BOOST_STATIC_ASSERT(( boost::container::allocator_traits
+ < ComplexAllocator<int> >::is_partially_propagable::value == true ));
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::rebind_traits<double>::allocator_type
, ComplexAllocator<double> >::value ));
- BOOST_STATIC_ASSERT(( boost::is_same<boost::container::allocator_traits
+ BOOST_STATIC_ASSERT(( is_same<boost::container::allocator_traits
< ComplexAllocator<int> >::rebind_alloc<double>::value_type
, double >::value ));
@@ -279,51 +323,43 @@ int main()
//allocate
CAllocTraits::allocate(c_alloc, 1);
- if(!c_alloc.allocate_called()){
- return 1;
- }
+ BOOST_TEST(c_alloc.allocate_called());
+
SAllocTraits::allocate(s_alloc, 1);
- if(!s_alloc.allocate_called()){
- return 1;
- }
+ BOOST_TEST(s_alloc.allocate_called());
//deallocate
CAllocTraits::deallocate(c_alloc, CAllocTraits::pointer(), 1);
- if(!c_alloc.deallocate_called()){
- return 1;
- }
+ BOOST_TEST(c_alloc.deallocate_called());
+
SAllocTraits::deallocate(s_alloc, SAllocTraits::pointer(), 1);
- if(!s_alloc.deallocate_called()){
- return 1;
- }
+ BOOST_TEST(s_alloc.deallocate_called());
//allocate with hint
CAllocTraits::allocate(c_alloc, 1, CAllocTraits::const_void_pointer());
- if(!c_alloc.allocate_hint_called()){
- return 1;
- }
+ BOOST_TEST(c_alloc.allocate_hint_called());
+
+ s_alloc.allocate_called_ = false;
SAllocTraits::allocate(s_alloc, 1, SAllocTraits::const_void_pointer());
+ BOOST_TEST(s_alloc.allocate_called());
//destroy
float dummy;
CAllocTraits::destroy(c_alloc, &dummy);
- if(!c_alloc.destroy_called()){
- return 1;
- }
+ BOOST_TEST(c_alloc.destroy_called());
+
SAllocTraits::destroy(s_alloc, &dummy);
//max_size
CAllocTraits::max_size(c_alloc);
- if(!c_alloc.max_size_called()){
- return 1;
- }
- SAllocTraits::max_size(s_alloc);
+ BOOST_TEST(c_alloc.max_size_called());
+
+ BOOST_TEST(SAllocTraits::size_type(-1)/sizeof(SAllocTraits::value_type) == SAllocTraits::max_size(s_alloc));
//select_on_container_copy_construction
CAllocTraits::select_on_container_copy_construction(c_alloc);
- if(!c_alloc.select_on_container_copy_construction_called()){
- return 1;
- }
+ BOOST_TEST(c_alloc.select_on_container_copy_construction_called());
+
SAllocTraits::select_on_container_copy_construction(s_alloc);
//construct
@@ -332,81 +368,80 @@ int main()
c.copymoveconstructed_ = true;
c.copymoveconstructed_ = true;
CAllocTraits::construct(c_alloc, &c);
- if(!c_alloc.construct_called() || c.copymoveconstructed() || c.moved()){
- return 1;
- }
+ BOOST_TEST(c_alloc.construct_called() && !c.copymoveconstructed() && !c.moved());
}
{
int i = 5;
CAllocTraits::construct(c_alloc, &i, boost::container::default_init);
- if(!c_alloc.construct_called() || i != 5){
- return 1;
- }
+ BOOST_TEST(c_alloc.construct_called() && i == 5);
}
{
copymovable c;
copymovable c2;
CAllocTraits::construct(c_alloc, &c, c2);
- if(!c_alloc.construct_called() || !c.copymoveconstructed() || c.moved()){
- return 1;
- }
+ BOOST_TEST(c_alloc.construct_called() && c.copymoveconstructed() && !c.moved());
}
{
copymovable c;
copymovable c2;
CAllocTraits::construct(c_alloc, &c, ::boost::move(c2));
- if(!c_alloc.construct_called() || !c.copymoveconstructed() || !c.moved()){
- return 1;
- }
+ BOOST_TEST(c_alloc.construct_called() && c.copymoveconstructed() && c.moved());
}
{
copymovable c;
c.copymoveconstructed_ = true;
c.copymoveconstructed_ = true;
SAllocTraits::construct(s_alloc, &c);
- if(c.copymoveconstructed() || c.moved()){
- return 1;
- }
+ BOOST_TEST(!c.copymoveconstructed() && !c.moved());
}
{
int i = 4;
SAllocTraits::construct(s_alloc, &i, boost::container::default_init);
- if(i != 4){
- return 1;
- }
+ BOOST_TEST(i == 4);
}
{
copymovable c;
copymovable c2;
SAllocTraits::construct(s_alloc, &c, c2);
- if(!c.copymoveconstructed() || c.moved()){
- return 1;
- }
+ BOOST_TEST(c.copymoveconstructed() && !c.moved());
}
{
copymovable c;
copymovable c2;
SAllocTraits::construct(s_alloc, &c, ::boost::move(c2));
- if(!c.copymoveconstructed() || !c.moved()){
- return 1;
- }
+ BOOST_TEST(c.copymoveconstructed() && c.moved());
}
{
copymovable c;
CAllocTraits::construct(c_alloc, &c, 0, 1, 2);
- if(!c_alloc.construct_called() || c.copymoveconstructed() || c.moved()){
- return 1;
- }
+ BOOST_TEST(c_alloc.construct_called() && !c.copymoveconstructed() && !c.moved());
}
{
copymovable c;
copymovable c2;
SAllocTraits::construct(s_alloc, &c, 0, 1, 2);
- if(c.copymoveconstructed() || c.moved()){
- return 1;
+ BOOST_TEST(!c.copymoveconstructed() && !c.moved());
+ }
+ //storage_is_unpropagable
+ {
+ SAlloc s_alloc2;
+ BOOST_TEST(!SAllocTraits::storage_is_unpropagable(s_alloc, SAllocTraits::pointer()));
+ }
+ {
+ {
+ CAlloc c_alloc2;
+ CAlloc::value_type v;
+ BOOST_TEST(!CAllocTraits::storage_is_unpropagable(c_alloc, CAllocTraits::pointer(&v)));
+ BOOST_TEST(c_alloc.storage_is_unpropagable_called());
+ }
+ {
+ CAlloc c_alloc2;
+ BOOST_TEST( CAllocTraits::storage_is_unpropagable(c_alloc2, CAllocTraits::pointer()));
+ BOOST_TEST(c_alloc2.storage_is_unpropagable_called());
}
+
}
- return 0;
+ return ::boost::report_errors();
}
#include <boost/container/detail/config_end.hpp>
diff --git a/libs/container/test/check_equal_containers.hpp b/libs/container/test/check_equal_containers.hpp
index b742891b9..0f67a6a4e 100644
--- a/libs/container/test/check_equal_containers.hpp
+++ b/libs/container/test/check_equal_containers.hpp
@@ -14,11 +14,11 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/pair.hpp>
#include <boost/container/detail/mpl.hpp>
-#include <functional>
-#include <iostream>
-#include <algorithm>
#include <boost/move/unique_ptr.hpp>
+#include <cstddef>
+#include <boost/container/detail/iterator.hpp>
+
namespace boost{
namespace container {
namespace test{
@@ -59,22 +59,26 @@ bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2
}
//Function to check if both containers are equal
-template<class MyBoostCont
- ,class MyStdCont>
-bool CheckEqualContainers(const MyBoostCont &boostcont, const MyStdCont &stdcont)
+template<class ContA
+ ,class ContB>
+bool CheckEqualContainers(const ContA &cont_a, const ContB &cont_b)
{
- if(boostcont.size() != stdcont.size())
+ if(cont_a.size() != cont_b.size())
return false;
- typename MyBoostCont::const_iterator itboost(boostcont.begin()), itboostend(boostcont.end());
- typename MyStdCont::const_iterator itstd(stdcont.begin());
- typename MyStdCont::size_type dist = (typename MyStdCont::size_type)std::distance(itboost, itboostend);
- if(dist != boostcont.size()){
+ typename ContA::const_iterator itcont_a(cont_a.begin()), itcont_a_end(cont_a.end());
+ typename ContB::const_iterator itcont_b(cont_b.begin()), itcont_b_end(cont_b.end());;
+ typename ContB::size_type dist = (typename ContB::size_type)boost::container::iterator_distance(itcont_a, itcont_a_end);
+ if(dist != cont_a.size()){
+ return false;
+ }
+ typename ContA::size_type dist2 = (typename ContA::size_type)boost::container::iterator_distance(itcont_b, itcont_b_end);
+ if(dist2 != cont_b.size()){
return false;
}
std::size_t i = 0;
- for(; itboost != itboostend; ++itboost, ++itstd, ++i){
- if(!CheckEqual(*itstd, *itboost))
+ for(; itcont_a != itcont_a_end; ++itcont_a, ++itcont_b, ++i){
+ if(!CheckEqual(*itcont_a, *itcont_b))
return false;
}
return true;
@@ -101,6 +105,7 @@ bool CheckEqualPairContainers(const MyBoostCont &boostcont, const MyStdCont &std
}
return true;
}
+
} //namespace test{
} //namespace container {
} //namespace boost{
diff --git a/libs/container/test/container_common_tests.hpp b/libs/container/test/container_common_tests.hpp
new file mode 100644
index 000000000..af57eb640
--- /dev/null
+++ b/libs/container/test/container_common_tests.hpp
@@ -0,0 +1,86 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2014-2014. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_CONTAINER_COMMON_TESTS_HPP
+#define BOOST_CONTAINER_TEST_CONTAINER_COMMON_TESTS_HPP
+
+#include <boost/container/detail/config_begin.hpp>
+
+namespace boost{
+namespace container {
+namespace test{
+
+
+template<class Container>
+const Container &as_const(Container &c)
+{ return c; }
+
+//nth, index_of
+template<class Container>
+bool test_nth_index_of(Container &c)
+{
+ typename Container::iterator it;
+ typename Container::const_iterator cit;
+ typename Container::size_type sz, csz;
+ //index 0
+ it = c.nth(0);
+ sz = c.index_of(it);
+ cit = as_const(c).nth(0);
+ csz = as_const(c).index_of(cit);
+
+ if(it != c.begin())
+ return false;
+ if(cit != c.cbegin())
+ return false;
+ if(sz != 0)
+ return false;
+ if(csz != 0)
+ return false;
+
+ //index size()/2
+ const typename Container::size_type sz_div_2 = c.size()/2;
+ it = c.nth(sz_div_2);
+ sz = c.index_of(it);
+ cit = as_const(c).nth(sz_div_2);
+ csz = as_const(c).index_of(cit);
+
+ if(it != (c.begin()+sz_div_2))
+ return false;
+ if(cit != (c.cbegin()+sz_div_2))
+ return false;
+ if(sz != sz_div_2)
+ return false;
+ if(csz != sz_div_2)
+ return false;
+
+ //index size()
+ it = c.nth(c.size());
+ sz = c.index_of(it);
+ cit = as_const(c).nth(c.size());
+ csz = as_const(c).index_of(cit);
+
+ if(it != c.end())
+ return false;
+ if(cit != c.cend())
+ return false;
+ if(sz != c.size())
+ return false;
+ if(csz != c.size())
+ return false;
+ return true;
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_TEST_CONTAINER_COMMON_TESTS_HPP
diff --git a/libs/container/test/default_init_test.hpp b/libs/container/test/default_init_test.hpp
index 4af9d5988..aa64ab01b 100644
--- a/libs/container/test/default_init_test.hpp
+++ b/libs/container/test/default_init_test.hpp
@@ -12,27 +12,7 @@
#define BOOST_CONTAINER_TEST_DEFAULT_INIT_TEST_HEADER
#include <boost/container/detail/config_begin.hpp>
-#include <algorithm>
-#include <memory>
-#include <vector>
-#include <iostream>
-#include <functional>
-#include <list>
-
-#include <boost/move/utility_core.hpp>
-#include <boost/container/detail/mpl.hpp>
-#include "print_container.hpp"
-#include "check_equal_containers.hpp"
-#include "movable_int.hpp"
-#include <string>
-#include <vector>
-#include "emplace_test.hpp"
-#include "input_from_forward_iterator.hpp"
-#include <boost/move/utility_core.hpp>
-#include <boost/move/iterator.hpp>
-#include <boost/core/no_exceptions_support.hpp>
-#include <boost/static_assert.hpp>
-#include "insert_test.hpp"
+#include <cstddef>
namespace boost{
namespace container {
@@ -141,6 +121,17 @@ bool default_init_test()//Test for default initialization
}
}
{
+ test::default_init_allocator<int>::reset_pattern(0);
+ test::default_init_allocator<int>::set_ascending(true);
+ IntDefaultInitAllocVector v(Capacity, default_init, test::default_init_allocator<int>());
+ typename IntDefaultInitAllocVector::iterator it = v.begin();
+ //Compare with the pattern
+ for(std::size_t i = 0; i != Capacity; ++i, ++it){
+ if(!test::check_ascending_byte_pattern(*it))
+ return false;
+ }
+ }
+ {
test::default_init_allocator<int>::reset_pattern(100);
test::default_init_allocator<int>::set_ascending(false);
IntDefaultInitAllocVector v;
diff --git a/libs/container/test/deque_test.cpp b/libs/container/test/deque_test.cpp
index 4e0b30e27..3a32e6bf5 100644
--- a/libs/container/test/deque_test.cpp
+++ b/libs/container/test/deque_test.cpp
@@ -9,11 +9,9 @@
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
-#include <algorithm>
#include <memory>
#include <deque>
#include <iostream>
-#include <functional>
#include <list>
#include <boost/container/deque.hpp>
@@ -337,36 +335,21 @@ int test_cont_variants()
return 0;
}
-bool test_support_for_initialization_list()
-{
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- const std::initializer_list<int> il = {1, 10, 11};
- const deque<int> expectedDeque(il.begin(), il.end());
-
- const deque<int> testConstructor = il;
- if(testConstructor != expectedDeque)
- return false;
-
- deque<int> testAssignmentOperator = {11, 12, 23};
- testAssignmentOperator = il;
- if(testConstructor != expectedDeque)
- return false;
+struct boost_container_deque;
- deque<int> testAssignmentMethod = {11, 12, 23};
- testAssignmentMethod.assign(il);
- if(testConstructor != expectedDeque)
- return false;
+namespace boost { namespace container { namespace test {
- deque<int> testInsertMethod = {11};
- testInsertMethod.insert(testInsertMethod.cbegin(), {12, 23});
- if(testConstructor != expectedDeque)
- return false;
-
- return true;
-#endif
- return true;
+template<>
+struct alloc_propagate_base<boost_container_deque>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::deque<T, Allocator> type;
+ };
+};
-}
+}}} //namespace boost::container::test
int main ()
{
@@ -422,9 +405,6 @@ int main ()
return 1;
}
- if(!test_support_for_initialization_list())
- return 1;
-
////////////////////////////////////
// Emplace testing
////////////////////////////////////
@@ -436,8 +416,17 @@ int main ()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<deque>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_deque>())
+ return 1;
+
+ ////////////////////////////////////
+ // Initializer lists testing
+ ////////////////////////////////////
+ if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for
+ < boost::container::deque<int> >()) {
return 1;
+ }
+ return 0;
return 0;
}
diff --git a/libs/container/test/dummy_test_allocator.hpp b/libs/container/test/dummy_test_allocator.hpp
index 3ecfc98c1..a9f0b8252 100644
--- a/libs/container/test/dummy_test_allocator.hpp
+++ b/libs/container/test/dummy_test_allocator.hpp
@@ -11,23 +11,32 @@
#ifndef BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP
#define BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP
-#if defined(_MSC_VER)
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-
#include <boost/container/container_fwd.hpp>
+
+#include <boost/container/throw_exception.hpp>
+
+#include <boost/container/detail/addressof.hpp>
#include <boost/container/detail/allocation_type.hpp>
-#include <boost/assert.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/mpl.hpp>
-#include <boost/container/detail/version_type.hpp>
#include <boost/container/detail/multiallocation_chain.hpp>
-#include <boost/container/throw_exception.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/version_type.hpp>
+
#include <boost/move/utility_core.hpp>
+#include <boost/move/adl_move_swap.hpp>
+
+#include <boost/assert.hpp>
+
#include <memory>
#include <algorithm>
#include <cstddef>
@@ -135,12 +144,8 @@ class dummy_test_allocator
//Experimental version 2 dummy_test_allocator functions
- std::pair<pointer, bool>
- allocation_command(boost::container::allocation_type,
- size_type,
- size_type,
- size_type &, const pointer & = 0)
- { return std::pair<pointer, bool>(pointer(), true); }
+ pointer allocation_command(boost::container::allocation_type, size_type, size_type &, pointer &p)
+ { p = pointer(); return pointer(); }
//!Returns maximum the number of objects the previously allocated memory
//!pointed by p can hold.
@@ -233,7 +238,7 @@ class propagation_test_allocator
{ return CopyOnPropagateOnContSwap ? propagation_test_allocator(*this) : propagation_test_allocator(); }
explicit propagation_test_allocator()
- : id_(unique_id_++)
+ : id_(++unique_id_)
, ctr_copies_(0)
, ctr_moves_(0)
, assign_copies_(0)
@@ -258,7 +263,7 @@ class propagation_test_allocator
, PropagateOnContSwap
, CopyOnPropagateOnContSwap> &x)
: id_(x.id_)
- , ctr_copies_(0)
+ , ctr_copies_(x.ctr_copies_+1)
, ctr_moves_(0)
, assign_copies_(0)
, assign_moves_(0)
@@ -296,8 +301,8 @@ class propagation_test_allocator
return *this;
}
- static void reset_unique_id()
- { unique_id_ = 0; }
+ static void reset_unique_id(unsigned id = 0)
+ { unique_id_ = id; }
T* allocate(std::size_t n)
{ return (T*)::new char[sizeof(T)*n]; }
@@ -314,12 +319,12 @@ class propagation_test_allocator
void swap(propagation_test_allocator &r)
{
++this->swaps_; ++r.swaps_;
- boost::container::swap_dispatch(this->id_, r.id_);
- boost::container::swap_dispatch(this->ctr_copies_, r.ctr_copies_);
- boost::container::swap_dispatch(this->ctr_moves_, r.ctr_moves_);
- boost::container::swap_dispatch(this->assign_copies_, r.assign_copies_);
- boost::container::swap_dispatch(this->assign_moves_, r.assign_moves_);
- boost::container::swap_dispatch(this->swaps_, r.swaps_);
+ boost::adl_move_swap(this->id_, r.id_);
+ boost::adl_move_swap(this->ctr_copies_, r.ctr_copies_);
+ boost::adl_move_swap(this->ctr_moves_, r.ctr_moves_);
+ boost::adl_move_swap(this->assign_copies_, r.assign_copies_);
+ boost::adl_move_swap(this->assign_moves_, r.assign_moves_);
+ boost::adl_move_swap(this->swaps_, r.swaps_);
}
friend void swap(propagation_test_allocator &l, propagation_test_allocator &r)
diff --git a/libs/container/test/emplace_test.hpp b/libs/container/test/emplace_test.hpp
index 62824c5a2..50fe65642 100644
--- a/libs/container/test/emplace_test.hpp
+++ b/libs/container/test/emplace_test.hpp
@@ -16,8 +16,7 @@
#include <boost/container/detail/workaround.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/move/utility_core.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <boost/aligned_storage.hpp>
+#include <boost/container/detail/type_traits.hpp>
namespace boost{
namespace container {
@@ -147,7 +146,7 @@ bool test_expected_container(const Container &ec, const std::pair<EmplaceInt, Em
static EmplaceInt expected [10];
typedef std::pair<EmplaceInt, EmplaceInt> EmplaceIntPair;
-static boost::aligned_storage<sizeof(EmplaceIntPair)*10>::type pair_storage;
+static boost::container::container_detail::aligned_storage<sizeof(EmplaceIntPair)*10>::type pair_storage;
static EmplaceIntPair* initialize_emplace_int_pair()
{
diff --git a/libs/container/test/expand_bwd_test_allocator.hpp b/libs/container/test/expand_bwd_test_allocator.hpp
index f7ba3049d..2e1609384 100644
--- a/libs/container/test/expand_bwd_test_allocator.hpp
+++ b/libs/container/test/expand_bwd_test_allocator.hpp
@@ -11,19 +11,28 @@
#ifndef BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP
#define BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP
-#if defined(_MSC_VER)
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-
#include <boost/container/container_fwd.hpp>
+
#include <boost/container/throw_exception.hpp>
+
+#include <boost/container/detail/addressof.hpp>
#include <boost/container/detail/allocation_type.hpp>
-#include <boost/assert.hpp>
-#include <boost/container/detail/utilities.hpp>
#include <boost/container/detail/version_type.hpp>
+
+#include <boost/move/adl_move_swap.hpp>
+
+#include <boost/assert.hpp>
+
#include <memory>
#include <algorithm>
#include <cstddef>
@@ -109,42 +118,40 @@ class expand_bwd_test_allocator
friend void swap(self_t &alloc1, self_t &alloc2)
{
- boost::container::swap_dispatch(alloc1.mp_buffer, alloc2.mp_buffer);
- boost::container::swap_dispatch(alloc1.m_size, alloc2.m_size);
- boost::container::swap_dispatch(alloc1.m_offset, alloc2.m_offset);
+ boost::adl_move_swap(alloc1.mp_buffer, alloc2.mp_buffer);
+ boost::adl_move_swap(alloc1.m_size, alloc2.m_size);
+ boost::adl_move_swap(alloc1.m_offset, alloc2.m_offset);
}
//Experimental version 2 expand_bwd_test_allocator functions
- std::pair<pointer, bool>
- allocation_command(boost::container::allocation_type command,
- size_type limit_size,
- size_type preferred_size,
- size_type &received_size, const pointer &reuse = 0)
+ pointer allocation_command(boost::container::allocation_type command,
+ size_type limit_size,size_type &prefer_in_recvd_out_size,pointer &reuse)
{
- (void)preferred_size; (void)reuse; (void)command;
+ (void)reuse; (void)command;
//This allocator only expands backwards!
assert(m_allocations == 0 || (command & boost::container::expand_bwd));
- received_size = limit_size;
+ prefer_in_recvd_out_size = limit_size;
if(m_allocations == 0){
if((m_offset + limit_size) > m_size){
assert(0);
}
++m_allocations;
- return std::pair<pointer, bool>(mp_buffer + m_offset, false);
+ reuse = 0;
+ return (mp_buffer + m_offset);
}
else if(m_allocations == 1){
if(limit_size > m_size){
assert(0);
}
++m_allocations;
- return std::pair<pointer, bool>(mp_buffer, true);
+ return mp_buffer;
}
else{
throw_bad_alloc();
- return std::pair<pointer, bool>(mp_buffer, true);
+ return mp_buffer;
}
}
diff --git a/libs/container/test/expand_bwd_test_template.hpp b/libs/container/test/expand_bwd_test_template.hpp
index 7d6486df3..1c193ac66 100644
--- a/libs/container/test/expand_bwd_test_template.hpp
+++ b/libs/container/test/expand_bwd_test_template.hpp
@@ -14,10 +14,10 @@
#include <boost/container/detail/config_begin.hpp>
#include <vector>
#include <typeinfo>
+#include <iostream>
#include "expand_bwd_test_allocator.hpp"
-#include <algorithm>
+#include <boost/container/detail/algorithm.hpp> //equal()
#include "movable_int.hpp"
-#include <boost/type_traits/remove_volatile.hpp>
#include <boost/move/make_unique.hpp>
namespace boost { namespace container { namespace test {
@@ -28,7 +28,7 @@ bool CheckEqualVector(const Vector1 &vector1, const Vector2 &vector2)
{
if(vector1.size() != vector2.size())
return false;
- return std::equal(vector1.begin(), vector1.end(), vector2.begin());
+ return boost::container::algo_equal(vector1.begin(), vector1.end(), vector2.begin());
}
template<class Vector>
@@ -55,8 +55,7 @@ template<class VectorWithExpandBwdAllocator>
bool test_insert_with_expand_bwd()
{
typedef typename VectorWithExpandBwdAllocator::value_type value_type;
- typedef typename boost::remove_volatile<value_type>::type non_volatile_value_type;
- typedef std::vector<non_volatile_value_type> Vect;
+ typedef std::vector<value_type> Vect;
const unsigned int MemorySize = 1000;
//Distance old and new buffer
@@ -79,12 +78,15 @@ bool test_insert_with_expand_bwd()
{ 0, 100, 200 };
for(unsigned int pos = 0; pos < sizeof(Position)/sizeof(Position[0]); ++pos){
+ if(!life_count<value_type>::check(0))
+ return false;
+
for(unsigned int iteration = 0; iteration < Iterations; ++iteration)
{
boost::movelib::unique_ptr<char[]> memptr =
boost::movelib::make_unique_definit<char[]>(MemorySize*sizeof(value_type));
value_type *memory = (value_type*)memptr.get();
- std::vector<non_volatile_value_type> initial_data;
+ std::vector<value_type> initial_data;
initial_data.resize(InitialSize[iteration]);
for(unsigned int i = 0; i < InitialSize[iteration]; ++i){
initial_data[i] = i;
@@ -122,6 +124,8 @@ bool test_insert_with_expand_bwd()
return false;
}
}
+ if(!life_count<value_type>::check(0))
+ return false;
}
return true;
@@ -133,7 +137,6 @@ template<class VectorWithExpandBwdAllocator>
bool test_assign_with_expand_bwd()
{
typedef typename VectorWithExpandBwdAllocator::value_type value_type;
- typedef typename boost::remove_volatile<value_type>::type non_volatile_value_type;
const unsigned int MemorySize = 200;
const unsigned int Offset[] = { 50, 50, 50};
@@ -147,14 +150,14 @@ bool test_assign_with_expand_bwd()
boost::movelib::make_unique_definit<char[]>(MemorySize*sizeof(value_type));
value_type *memory = (value_type*)memptr.get();
//Create initial data
- std::vector<non_volatile_value_type> initial_data;
+ std::vector<value_type> initial_data;
initial_data.resize(InitialSize[iteration]);
for(unsigned int i = 0; i < InitialSize[iteration]; ++i){
initial_data[i] = i;
}
//Create data to assign
- std::vector<non_volatile_value_type> data_to_insert;
+ std::vector<value_type> data_to_insert;
data_to_insert.resize(InsertSize[iteration]);
for(unsigned int i = 0; i < InsertSize[iteration]; ++i){
data_to_insert[i] = -i;
diff --git a/libs/container/test/explicit_inst_deque_test.cpp b/libs/container/test/explicit_inst_deque_test.cpp
new file mode 100644
index 000000000..77163db94
--- /dev/null
+++ b/libs/container/test/explicit_inst_deque_test.cpp
@@ -0,0 +1,26 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/deque.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::deque<empty>;
+
+int main()
+{
+ ::boost::container::deque<empty> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_flat_map_test.cpp b/libs/container/test/explicit_inst_flat_map_test.cpp
new file mode 100644
index 000000000..77925d8cc
--- /dev/null
+++ b/libs/container/test/explicit_inst_flat_map_test.cpp
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/flat_map.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::flat_map<empty, empty>;
+template class ::boost::container::flat_multimap<empty, empty>;
+
+int main()
+{
+ ::boost::container::flat_map<empty, empty> dummy;
+ ::boost::container::flat_multimap<empty, empty> dummy2;
+ (void)dummy; (void)dummy2;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_flat_set_test.cpp b/libs/container/test/explicit_inst_flat_set_test.cpp
new file mode 100644
index 000000000..a9c482f9f
--- /dev/null
+++ b/libs/container/test/explicit_inst_flat_set_test.cpp
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/flat_set.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::flat_set<empty>;
+template class ::boost::container::flat_multiset<empty>;
+
+int main()
+{
+ ::boost::container::flat_set<empty> dummy;
+ ::boost::container::flat_multiset<empty> dummy2;
+ (void)dummy; (void)dummy2;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_list_test.cpp b/libs/container/test/explicit_inst_list_test.cpp
new file mode 100644
index 000000000..b038594e7
--- /dev/null
+++ b/libs/container/test/explicit_inst_list_test.cpp
@@ -0,0 +1,26 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/list.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::list<empty>;
+
+int main()
+{
+ ::boost::container::list<empty> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_map_test.cpp b/libs/container/test/explicit_inst_map_test.cpp
new file mode 100644
index 000000000..4a19429fc
--- /dev/null
+++ b/libs/container/test/explicit_inst_map_test.cpp
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/map.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::map<empty, empty>;
+template class ::boost::container::multimap<empty, empty>;
+
+int main()
+{
+ ::boost::container::map<empty, empty> dummy;
+ ::boost::container::multimap<empty, empty> dummy2;
+ (void)dummy; (void)dummy2;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_set_test.cpp b/libs/container/test/explicit_inst_set_test.cpp
new file mode 100644
index 000000000..7116c9641
--- /dev/null
+++ b/libs/container/test/explicit_inst_set_test.cpp
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/set.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::set<empty>;
+template class ::boost::container::multiset<empty>;
+
+int main()
+{
+ ::boost::container::set<empty> dummy;
+ ::boost::container::multiset<empty> dummy2;
+ (void)dummy; (void)dummy2;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_slist_test.cpp b/libs/container/test/explicit_inst_slist_test.cpp
new file mode 100644
index 000000000..ed4b5ae9c
--- /dev/null
+++ b/libs/container/test/explicit_inst_slist_test.cpp
@@ -0,0 +1,26 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/slist.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::slist<empty>;
+
+int main()
+{
+ ::boost::container::slist<empty> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_stable_vector_test.cpp b/libs/container/test/explicit_inst_stable_vector_test.cpp
new file mode 100644
index 000000000..cdd3bdd87
--- /dev/null
+++ b/libs/container/test/explicit_inst_stable_vector_test.cpp
@@ -0,0 +1,26 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/stable_vector.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::stable_vector<empty>;
+
+int main()
+{
+ ::boost::container::stable_vector<empty> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_static_vector_test.cpp b/libs/container/test/explicit_inst_static_vector_test.cpp
new file mode 100644
index 000000000..6681f7cd2
--- /dev/null
+++ b/libs/container/test/explicit_inst_static_vector_test.cpp
@@ -0,0 +1,26 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/static_vector.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::static_vector<empty, 2>;
+
+int main()
+{
+ ::boost::container::static_vector<empty, 2> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_string_test.cpp b/libs/container/test/explicit_inst_string_test.cpp
new file mode 100644
index 000000000..f911bb03f
--- /dev/null
+++ b/libs/container/test/explicit_inst_string_test.cpp
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/string.hpp>
+
+template class ::boost::container::basic_string<char>;
+
+int main()
+{
+ ::boost::container::basic_string<char> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/explicit_inst_vector_test.cpp b/libs/container/test/explicit_inst_vector_test.cpp
new file mode 100644
index 000000000..b03427ceb
--- /dev/null
+++ b/libs/container/test/explicit_inst_vector_test.cpp
@@ -0,0 +1,26 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/vector.hpp>
+
+struct empty
+{
+ friend bool operator == (const empty &, const empty &){ return true; }
+ friend bool operator < (const empty &, const empty &){ return true; }
+};
+
+template class ::boost::container::vector<empty>;
+
+int main()
+{
+ ::boost::container::vector<empty> dummy;
+ (void)dummy;
+ return 0;
+}
diff --git a/libs/container/test/flat_map_test.cpp b/libs/container/test/flat_map_test.cpp
index b0ae33021..8a8ec0895 100644
--- a/libs/container/test/flat_map_test.cpp
+++ b/libs/container/test/flat_map_test.cpp
@@ -13,15 +13,19 @@
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
+#include <boost/container/detail/flat_tree.hpp>
#include "print_container.hpp"
#include "dummy_test_allocator.hpp"
#include "movable_int.hpp"
#include "map_test.hpp"
#include "propagate_allocator_test.hpp"
+#include "container_common_tests.hpp"
#include "emplace_test.hpp"
+
#include <vector>
-#include <boost/container/detail/flat_tree.hpp>
+#include <map>
+
using namespace boost::container;
@@ -179,7 +183,7 @@ public:
flat_multimap<recursive_flat_multimap, recursive_flat_multimap>::const_iterator cit_;
flat_multimap<recursive_flat_multimap, recursive_flat_multimap>::reverse_iterator rit_;
flat_multimap<recursive_flat_multimap, recursive_flat_multimap>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_flat_multimap &a, const recursive_flat_multimap &b)
{ return a.id_ < b.id_; }
};
@@ -195,40 +199,6 @@ void test_move()
move_assign.swap(original);
}
-template<class T, class A>
-class flat_map_propagate_test_wrapper
- : public boost::container::flat_map
- < T, T, std::less<T>
- , typename boost::container::allocator_traits<A>::template
- portable_rebind_alloc< std::pair<T, T> >::type>
-{
- BOOST_COPYABLE_AND_MOVABLE(flat_map_propagate_test_wrapper)
- typedef boost::container::flat_map
- < T, T, std::less<T>
- , typename boost::container::allocator_traits<A>::template
- portable_rebind_alloc< std::pair<T, T> >::type> Base;
- public:
- flat_map_propagate_test_wrapper()
- : Base()
- {}
-
- flat_map_propagate_test_wrapper(const flat_map_propagate_test_wrapper &x)
- : Base(x)
- {}
-
- flat_map_propagate_test_wrapper(BOOST_RV_REF(flat_map_propagate_test_wrapper) x)
- : Base(boost::move(static_cast<Base&>(x)))
- {}
-
- flat_map_propagate_test_wrapper &operator=(BOOST_COPY_ASSIGN_REF(flat_map_propagate_test_wrapper) x)
- { this->Base::operator=(x); return *this; }
-
- flat_map_propagate_test_wrapper &operator=(BOOST_RV_REF(flat_map_propagate_test_wrapper) x)
- { this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
-
- void swap(flat_map_propagate_test_wrapper &x)
- { this->Base::swap(x); }
-};
namespace boost{
namespace container {
@@ -343,6 +313,49 @@ struct GetAllocatorMap
};
};
+struct boost_container_flat_map;
+struct boost_container_flat_multimap;
+
+namespace boost { namespace container { namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_flat_map>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef typename boost::container::allocator_traits<Allocator>::
+ template portable_rebind_alloc<std::pair<T, T> >::type TypeAllocator;
+ typedef boost::container::flat_map<T, T, std::less<T>, TypeAllocator> type;
+ };
+};
+
+template<>
+struct alloc_propagate_base<boost_container_flat_multimap>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef typename boost::container::allocator_traits<Allocator>::
+ template portable_rebind_alloc<std::pair<T, T> >::type TypeAllocator;
+ typedef boost::container::flat_multimap<T, T, std::less<T>, TypeAllocator> type;
+ };
+};
+
+template <class Key, class T, class Compare, class Allocator>
+struct get_real_stored_allocator<flat_map<Key, T, Compare, Allocator> >
+{
+ typedef typename flat_map<Key, T, Compare, Allocator>::impl_stored_allocator_type type;
+};
+
+template <class Key, class T, class Compare, class Allocator>
+struct get_real_stored_allocator<flat_multimap<Key, T, Compare, Allocator> >
+{
+ typedef typename flat_multimap<Key, T, Compare, Allocator>::impl_stored_allocator_type type;
+};
+
+}}} //namespace boost::container::test
+
template<class VoidAllocator>
int test_map_variants()
{
@@ -398,53 +411,36 @@ int test_map_variants()
return 0;
}
-template<typename FlatMapType>
-bool test_support_for_initialization_list_for()
-{
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- const std::initializer_list<std::pair<int, int>> il
- = {std::make_pair(1, 2), std::make_pair(3, 4)};
-
- const FlatMapType expected(il.begin(), il.end());
- {
- const FlatMapType sil = il;
- if (sil != expected)
- return false;
-
- const FlatMapType sil_ordered(ordered_unique_range, il);
- if(sil_ordered != expected)
- return false;
-
- FlatMapType sil_assign = {std::make_pair(99, 100)};
- sil_assign = il;
- if(sil_assign != expected)
- return false;
- }
- {
- FlatMapType sil;
- sil.insert(il);
- if(sil != expected)
- return false;
- }
- return true;
-#endif
- return true;
-}
-
int main()
{
using namespace boost::container::test;
//Allocator argument container
{
- flat_map<int, int> map_((std::allocator<std::pair<int, int> >()));
- flat_multimap<int, int> multimap_((std::allocator<std::pair<int, int> >()));
+ flat_map<int, int> map_((flat_map<int, int>::allocator_type()));
+ flat_multimap<int, int> multimap_((flat_multimap<int, int>::allocator_type()));
}
//Now test move semantics
{
test_move<flat_map<recursive_flat_map, recursive_flat_map> >();
test_move<flat_multimap<recursive_flat_multimap, recursive_flat_multimap> >();
}
+ //Now test nth/index_of
+ {
+ flat_map<int, int> map;
+ flat_multimap<int, int> mmap;
+
+ map.insert(std::pair<int, int>(0, 0));
+ map.insert(std::pair<int, int>(1, 0));
+ map.insert(std::pair<int, int>(2, 0));
+ mmap.insert(std::pair<int, int>(0, 0));
+ mmap.insert(std::pair<int, int>(1, 0));
+ mmap.insert(std::pair<int, int>(2, 0));
+ if(!boost::container::test::test_nth_index_of(map))
+ return 1;
+ if(!boost::container::test::test_nth_index_of(mmap))
+ return 1;
+ }
////////////////////////////////////
// Ordered insertion test
@@ -477,10 +473,10 @@ int main()
return 1;
}
- if(!test_support_for_initialization_list_for<flat_map<int, int> >())
+ if(!boost::container::test::test_map_support_for_initialization_list_for<flat_map<int, int> >())
return 1;
- if(!test_support_for_initialization_list_for<flat_multimap<int, int> >())
+ if (!boost::container::test::test_map_support_for_initialization_list_for<flat_multimap<int, int> >())
return 1;
////////////////////////////////////
@@ -496,7 +492,10 @@ int main()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<flat_map_propagate_test_wrapper>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_flat_map>())
+ return 1;
+
+ if(!boost::container::test::test_propagate_allocator<boost_container_flat_multimap>())
return 1;
return 0;
diff --git a/libs/container/test/flat_set_test.cpp b/libs/container/test/flat_set_test.cpp
index 9e9e8c9d4..26b5a6395 100644
--- a/libs/container/test/flat_set_test.cpp
+++ b/libs/container/test/flat_set_test.cpp
@@ -21,6 +21,7 @@
#include "set_test.hpp"
#include "propagate_allocator_test.hpp"
#include "emplace_test.hpp"
+#include "container_common_tests.hpp"
#include <vector>
#include <boost/container/detail/flat_tree.hpp>
@@ -183,7 +184,7 @@ class recursive_flat_set
flat_set<recursive_flat_set>::const_iterator cit_;
flat_set<recursive_flat_set>::reverse_iterator rit_;
flat_set<recursive_flat_set>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_flat_set &a, const recursive_flat_set &b)
{ return a.id_ < b.id_; }
};
@@ -209,7 +210,7 @@ class recursive_flat_multiset
flat_multiset<recursive_flat_multiset>::const_iterator cit_;
flat_multiset<recursive_flat_multiset>::reverse_iterator rit_;
flat_multiset<recursive_flat_multiset>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_flat_multiset &a, const recursive_flat_multiset &b)
{ return a.id_ < b.id_; }
};
@@ -226,35 +227,6 @@ void test_move()
move_assign.swap(original);
}
-template<class T, class A>
-class flat_set_propagate_test_wrapper
- : public boost::container::flat_set<T, std::less<T>, A>
-{
- BOOST_COPYABLE_AND_MOVABLE(flat_set_propagate_test_wrapper)
- typedef boost::container::flat_set<T, std::less<T>, A> Base;
- public:
- flat_set_propagate_test_wrapper()
- : Base()
- {}
-
- flat_set_propagate_test_wrapper(const flat_set_propagate_test_wrapper &x)
- : Base(x)
- {}
-
- flat_set_propagate_test_wrapper(BOOST_RV_REF(flat_set_propagate_test_wrapper) x)
- : Base(boost::move(static_cast<Base&>(x)))
- {}
-
- flat_set_propagate_test_wrapper &operator=(BOOST_COPY_ASSIGN_REF(flat_set_propagate_test_wrapper) x)
- { this->Base::operator=(x); return *this; }
-
- flat_set_propagate_test_wrapper &operator=(BOOST_RV_REF(flat_set_propagate_test_wrapper) x)
- { this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
-
- void swap(flat_set_propagate_test_wrapper &x)
- { this->Base::swap(x); }
-};
-
namespace boost{
namespace container {
namespace test{
@@ -517,20 +489,65 @@ bool test_support_for_initialization_list_for()
return true;
}
+struct boost_container_flat_set;
+struct boost_container_flat_multiset;
+
+namespace boost {
+namespace container {
+namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_flat_set>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::flat_set<T, std::less<T>, Allocator> type;
+ };
+};
+
+template<>
+struct alloc_propagate_base<boost_container_flat_multiset>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::flat_multiset<T, std::less<T>, Allocator> type;
+ };
+};
+
+}}} //boost::container::test
+
int main()
{
using namespace boost::container::test;
//Allocator argument container
{
- flat_set<int> set_((std::allocator<int>()));
- flat_multiset<int> multiset_((std::allocator<int>()));
+ flat_set<int> set_((flat_set<int>::allocator_type()));
+ flat_multiset<int> multiset_((flat_multiset<int>::allocator_type()));
}
//Now test move semantics
{
test_move<flat_set<recursive_flat_set> >();
test_move<flat_multiset<recursive_flat_multiset> >();
}
+ //Now test nth/index_of
+ {
+ flat_set<int> set;
+ flat_multiset<int> mset;
+
+ set.insert(0);
+ set.insert(1);
+ set.insert(2);
+ mset.insert(0);
+ mset.insert(1);
+ mset.insert(2);
+ if(!boost::container::test::test_nth_index_of(set))
+ return 1;
+ if(!boost::container::test::test_nth_index_of(mset))
+ return 1;
+ }
////////////////////////////////////
// Ordered insertion test
@@ -573,16 +590,19 @@ int main()
if(!boost::container::test::test_emplace<flat_multiset<test::EmplaceInt>, SetOptions>())
return 1;
- if(!test_support_for_initialization_list_for<flat_set<int> >())
+ if (!boost::container::test::test_set_methods_with_initializer_list_as_argument_for<flat_set<int> >())
return 1;
- if(!test_support_for_initialization_list_for<flat_multiset<int> >())
+ if (!boost::container::test::test_set_methods_with_initializer_list_as_argument_for<flat_multiset<int> >())
return 1;
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<flat_set_propagate_test_wrapper>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_flat_set>())
+ return 1;
+
+ if(!boost::container::test::test_propagate_allocator<boost_container_flat_multiset>())
return 1;
return 0;
diff --git a/libs/container/test/input_from_forward_iterator.hpp b/libs/container/test/input_from_forward_iterator.hpp
index ebc3973a5..9436ceffa 100644
--- a/libs/container/test/input_from_forward_iterator.hpp
+++ b/libs/container/test/input_from_forward_iterator.hpp
@@ -11,7 +11,7 @@
#ifndef BOOST_CONTAINER_TEST_FORWARD_TO_INPUT_ITERATOR_HPP
#define BOOST_CONTAINER_TEST_FORWARD_TO_INPUT_ITERATOR_HPP
-#include <iterator>
+#include <boost/container/detail/iterator.hpp>
namespace boost{
namespace container {
@@ -19,11 +19,11 @@ namespace test{
template<class FwdIterator>
class input_iterator_wrapper
- : public std::iterator< std::input_iterator_tag
- , typename std::iterator_traits<FwdIterator>::value_type
- , typename std::iterator_traits<FwdIterator>::difference_type
- , typename std::iterator_traits<FwdIterator>::pointer
- , typename std::iterator_traits<FwdIterator>::reference
+ : public boost::container::iterator< std::input_iterator_tag
+ , typename boost::container::iterator_traits<FwdIterator>::value_type
+ , typename boost::container::iterator_traits<FwdIterator>::difference_type
+ , typename boost::container::iterator_traits<FwdIterator>::pointer
+ , typename boost::container::iterator_traits<FwdIterator>::reference
>
{
FwdIterator m_it;
@@ -46,10 +46,10 @@ class input_iterator_wrapper
//Default destructor...
//~input_iterator_wrapper();
- typename std::iterator_traits<FwdIterator>::reference operator*() const
+ typename boost::container::iterator_traits<FwdIterator>::reference operator*() const
{ return *m_it; }
- typename std::iterator_traits<FwdIterator>::pointer operator->() const
+ typename boost::container::iterator_traits<FwdIterator>::pointer operator->() const
{ return m_it.operator->(); }
input_iterator_wrapper& operator++()
diff --git a/libs/container/test/insert_test.hpp b/libs/container/test/insert_test.hpp
index f29f496ff..cb862f3c5 100644
--- a/libs/container/test/insert_test.hpp
+++ b/libs/container/test/insert_test.hpp
@@ -53,7 +53,8 @@ bool test_range_insertion()
for (std::size_t i = 0; i <= input_deque.size(); ++i)
{
std::deque<int> std_deque;
- SeqContainer seq_container;
+ ::boost::movelib::unique_ptr<SeqContainer> const pseqcontainer = ::boost::movelib::make_unique<SeqContainer>();
+ SeqContainer &seq_container = *pseqcontainer;
for (int element = -10; element < 10; ++element)
{
diff --git a/libs/container/test/insert_vs_emplace_test.cpp b/libs/container/test/insert_vs_emplace_test.cpp
index c523dab46..b91a693c5 100644
--- a/libs/container/test/insert_vs_emplace_test.cpp
+++ b/libs/container/test/insert_vs_emplace_test.cpp
@@ -64,7 +64,7 @@ public:
X& operator=(BOOST_COPY_ASSIGN_REF(X) x)
{
-
+
i_ = x.i_;
p_ = x.p_;
// std::cout << "X& operator=(const X& x)\n";
@@ -72,7 +72,7 @@ public:
return *this;
}
- X(BOOST_RV_REF(X) x) BOOST_CONTAINER_NOEXCEPT
+ X(BOOST_RV_REF(X) x) BOOST_NOEXCEPT_OR_NOTHROW
: i_(x.i_)
, p_(x.p_)
{
@@ -80,9 +80,9 @@ public:
sp.mc++;
}
- X& operator=(BOOST_RV_REF(X) x) BOOST_CONTAINER_NOEXCEPT
+ X& operator=(BOOST_RV_REF(X) x) BOOST_NOEXCEPT_OR_NOTHROW
{
-
+
i_ = x.i_;
p_ = x.p_;
// std::cout << "X& operator=(X&& x)\n";
diff --git a/libs/container/test/list_test.cpp b/libs/container/test/list_test.cpp
index 1c035a74f..84588b798 100644
--- a/libs/container/test/list_test.cpp
+++ b/libs/container/test/list_test.cpp
@@ -53,9 +53,9 @@ template class boost::container::list
namespace container_detail {
-template class iterator
+template class iterator_from_iiterator
<intrusive_list_type< std::allocator<int> >::container_type::iterator, true >;
-template class iterator
+template class iterator_from_iiterator
<intrusive_list_type< std::allocator<int> >::container_type::iterator, false>;
}
@@ -71,7 +71,7 @@ public:
list<recursive_list>::const_iterator cit_;
list<recursive_list>::reverse_iterator rit_;
list<recursive_list>::const_reverse_iterator crit_;
-
+
recursive_list &operator=(const recursive_list &o)
{ list_ = o.list_; return *this; }
};
@@ -126,10 +126,14 @@ bool test_support_for_initializer_list()
const std::initializer_list<int> il = {1, 10};
const list<int> expectedList(il.begin(), il.end());
- const list<int> testConstructor = il;
+ const list<int> testConstructor((il));
if(testConstructor != expectedList)
return false;
+ const list<int> testConstructorAllocator(il, list<int>::allocator_type());
+ if (testConstructorAllocator != expectedList)
+ return false;
+
list<int> testAssignOperator = {10, 11};
testAssignOperator = il;
if(testAssignOperator != expectedList)
@@ -150,6 +154,22 @@ bool test_support_for_initializer_list()
return true;
}
+struct boost_container_list;
+
+namespace boost { namespace container { namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_list>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::list<T, Allocator> type;
+ };
+};
+
+}}} //namespace boost::container::test
+
int main ()
{
recursive_list_test();
@@ -197,7 +217,7 @@ int main ()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<list>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_list>())
return 1;
if(!test_support_for_initializer_list())
@@ -207,3 +227,13 @@ int main ()
}
#include <boost/container/detail/config_end.hpp>
+
+/*
+#include <boost/container/list.hpp>
+//#include <list>
+
+int main()
+{
+ return 0;
+}
+*/
diff --git a/libs/container/test/list_test.hpp b/libs/container/test/list_test.hpp
index 9aae06d9f..aec82c6f3 100644
--- a/libs/container/test/list_test.hpp
+++ b/libs/container/test/list_test.hpp
@@ -12,18 +12,17 @@
#define BOOST_CONTAINER_TEST_LIST_TEST_HEADER
#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/iterator.hpp>
#include "check_equal_containers.hpp"
-#include <memory>
-#include <list>
-#include <vector>
-#include <functional>
#include "print_container.hpp"
#include "input_from_forward_iterator.hpp"
#include <boost/move/utility_core.hpp>
#include <boost/move/iterator.hpp>
-#include <string>
#include <boost/move/make_unique.hpp>
+#include <list>
+#include <functional> //std::greater
+
namespace boost{
namespace container {
namespace test{
@@ -71,6 +70,32 @@ bool list_copyable_only(V1 &boostlist, V2 &stdlist, boost::container::container_
stdlist.push_front(int(3));
if(!test::CheckEqualContainers(boostlist, stdlist)) return false;
}
+ { //List(const List &)
+ ::boost::movelib::unique_ptr<V1> const pv1 = ::boost::movelib::make_unique<V1>(boostlist);
+ ::boost::movelib::unique_ptr<V2> const pv2 = ::boost::movelib::make_unique<V2>(stdlist);
+
+ V1 &v1 = *pv1;
+ V2 &v2 = *pv2;
+
+ boostlist.clear();
+ stdlist.clear();
+ boostlist.assign(v1.begin(), v1.end());
+ stdlist.assign(v2.begin(), v2.end());
+ if(!test::CheckEqualContainers(boostlist, stdlist)) return 1;
+ }
+ { //List(const List &, alloc)
+ ::boost::movelib::unique_ptr<V1> const pv1 = ::boost::movelib::make_unique<V1>(boostlist, typename V1::allocator_type());
+ ::boost::movelib::unique_ptr<V2> const pv2 = ::boost::movelib::make_unique<V2>(stdlist);
+
+ V1 &v1 = *pv1;
+ V2 &v2 = *pv2;
+
+ boostlist.clear();
+ stdlist.clear();
+ boostlist.assign(v1.begin(), v1.end());
+ stdlist.assign(v2.begin(), v2.end());
+ if(!test::CheckEqualContainers(boostlist, stdlist)) return 1;
+ }
return true;
}
@@ -149,6 +174,37 @@ int list_test (bool copied_allocators_equal = true)
const int max = 100;
typedef list_push_data_function<DoublyLinked> push_data_t;
+ { //List(n)
+ ::boost::movelib::unique_ptr<MyBoostList> const pboostlist = ::boost::movelib::make_unique<MyBoostList>(100);
+ ::boost::movelib::unique_ptr<MyStdList> const pstdlist = ::boost::movelib::make_unique<MyStdList>(100);
+ if(!test::CheckEqualContainers(*pboostlist, *pstdlist)) return 1;
+ }
+ { //List(n, alloc)
+ ::boost::movelib::unique_ptr<MyBoostList> const pboostlist = ::boost::movelib::make_unique<MyBoostList>(100, typename MyBoostList::allocator_type());
+ ::boost::movelib::unique_ptr<MyStdList> const pstdlist = ::boost::movelib::make_unique<MyStdList>(100);
+ if(!test::CheckEqualContainers(*pboostlist, *pstdlist)) return 1;
+ }
+ { //List(List &&)
+ ::boost::movelib::unique_ptr<MyStdList> const stdlistp = ::boost::movelib::make_unique<MyStdList>(100);
+ ::boost::movelib::unique_ptr<MyBoostList> const boostlistp = ::boost::movelib::make_unique<MyBoostList>(100);
+ ::boost::movelib::unique_ptr<MyBoostList> const boostlistp2 = ::boost::movelib::make_unique<MyBoostList>(::boost::move(*boostlistp));
+ if(!test::CheckEqualContainers(*boostlistp2, *stdlistp)) return 1;
+ }
+ { //List(List &&, alloc)
+ ::boost::movelib::unique_ptr<MyStdList> const stdlistp = ::boost::movelib::make_unique<MyStdList>(100);
+ ::boost::movelib::unique_ptr<MyBoostList> const boostlistp = ::boost::movelib::make_unique<MyBoostList>(100);
+ ::boost::movelib::unique_ptr<MyBoostList> const boostlistp2 = ::boost::movelib::make_unique<MyBoostList>
+ (::boost::move(*boostlistp), typename MyBoostList::allocator_type());
+ if(!test::CheckEqualContainers(*boostlistp2, *stdlistp)) return 1;
+ }
+ { //List operator=(List &&)
+ ::boost::movelib::unique_ptr<MyStdList> const stdlistp = ::boost::movelib::make_unique<MyStdList>(100);
+ ::boost::movelib::unique_ptr<MyBoostList> const boostlistp = ::boost::movelib::make_unique<MyBoostList>(100);
+ ::boost::movelib::unique_ptr<MyBoostList> const boostlistp2 = ::boost::movelib::make_unique<MyBoostList>();
+ *boostlistp2 = ::boost::move(*boostlistp);
+ if(!test::CheckEqualContainers(*boostlistp2, *stdlistp)) return 1;
+ }
+
::boost::movelib::unique_ptr<MyBoostList> const pboostlist = ::boost::movelib::make_unique<MyBoostList>();
::boost::movelib::unique_ptr<MyStdList> const pstdlist = ::boost::movelib::make_unique<MyStdList>();
@@ -229,7 +285,7 @@ int list_test (bool copied_allocators_equal = true)
boostlist.insert(boostlist.begin()
,boost::make_move_iterator(&aux_vect[0])
,boost::make_move_iterator(&aux_vect[50]));
- if(it_insert != boostlist.begin() || std::distance(it_insert, old_begin) != 50)
+ if(it_insert != boostlist.begin() || boost::container::iterator_distance(it_insert, old_begin) != 50)
return 1;
stdlist.insert(stdlist.begin(), &aux_vect2[0], &aux_vect2[50]);
@@ -249,7 +305,7 @@ int list_test (bool copied_allocators_equal = true)
it_insert = boostlist.insert(boostlist.end()
,boost::make_move_iterator(make_input_from_forward_iterator(&aux_vect[0]))
,boost::make_move_iterator(make_input_from_forward_iterator(&aux_vect[50])));
- if(std::distance(it_insert, boostlist.end()) != 50)
+ if(boost::container::iterator_distance(it_insert, boostlist.end()) != 50)
return 1;
stdlist.insert(stdlist.end(), &aux_vect2[0], &aux_vect2[50]);
if(!CheckEqualContainers(boostlist, stdlist))
@@ -285,6 +341,20 @@ int list_test (bool copied_allocators_equal = true)
if(!CheckEqualContainers(boostlist, stdlist))
return 1;
+ //some comparison operators
+ if(!(boostlist == boostlist))
+ return 1;
+ if(boostlist != boostlist)
+ return 1;
+ if(boostlist < boostlist)
+ return 1;
+ if(boostlist > boostlist)
+ return 1;
+ if(!(boostlist <= boostlist))
+ return 1;
+ if(!(boostlist >= boostlist))
+ return 1;
+
if(push_data_t::execute(max, boostlist, stdlist)){
return 1;
}
@@ -340,6 +410,56 @@ int list_test (bool copied_allocators_equal = true)
return 0;
}
+template<class List>
+bool test_list_methods_with_initializer_list_as_argument_for()
+{
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+ const std::initializer_list<int> il = {5, 10, 15};
+ const List expected_list(il.begin(), il.end());
+ {
+ List sl = il;
+ if(sl != expected_list)
+ return false;
+ }
+
+ {
+ List sl = {1, 2};
+ sl = il;
+ if(sl != expected_list)
+ return false;
+ }
+ {
+ List sl({ 1, 2 }, typename List::allocator_type());
+ sl = il;
+ if (sl != expected_list)
+ return false;
+ }
+ {
+ List sl = {4, 5};
+ sl.assign(il);
+ if(sl != expected_list)
+ return false;
+ }
+
+ {
+ List sl = {15};
+ sl.insert(sl.cbegin(), {5, 10});
+ if(sl != expected_list)
+ return false;
+ }
+
+ {
+ List sl = {5};
+ sl.insert_after(sl.cbegin(), {10, 15});
+ if(sl != expected_list)
+ return false;
+ }
+ return true;
+#endif
+ return true;
+}
+
+
} //namespace test{
} //namespace container {
} //namespace boost{
diff --git a/libs/container/test/map_test.cpp b/libs/container/test/map_test.cpp
index 505555f19..ebd1eaba1 100644
--- a/libs/container/test/map_test.cpp
+++ b/libs/container/test/map_test.cpp
@@ -12,7 +12,8 @@
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
-#include <utility>
+
+#include <map>
#include "print_container.hpp"
#include "movable_int.hpp"
@@ -199,7 +200,7 @@ class recursive_map
map<recursive_map, recursive_map>::const_iterator cit_;
map<recursive_map, recursive_map>::reverse_iterator rit_;
map<recursive_map, recursive_map>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_map &a, const recursive_map &b)
{ return a.id_ < b.id_; }
};
@@ -216,7 +217,7 @@ class recursive_multimap
multimap<recursive_multimap, recursive_multimap>::const_iterator cit_;
multimap<recursive_multimap, recursive_multimap>::reverse_iterator rit_;
multimap<recursive_multimap, recursive_multimap>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_multimap &a, const recursive_multimap &b)
{ return a.id_ < b.id_; }
};
@@ -234,45 +235,6 @@ void test_move()
move_assign.swap(original);
}
-template<class T, class A>
-class map_propagate_test_wrapper
- : public boost::container::map
- < T, T, std::less<T>
- , typename boost::container::allocator_traits<A>::template
- portable_rebind_alloc< std::pair<const T, T> >::type
- //tree_assoc_defaults
- >
-{
- BOOST_COPYABLE_AND_MOVABLE(map_propagate_test_wrapper)
- typedef boost::container::map
- < T, T, std::less<T>
- , typename boost::container::allocator_traits<A>::template
- portable_rebind_alloc< std::pair<const T, T> >::type
- > Base;
- public:
- map_propagate_test_wrapper()
- : Base()
- {}
-
- map_propagate_test_wrapper(const map_propagate_test_wrapper &x)
- : Base(x)
- {}
-
- map_propagate_test_wrapper(BOOST_RV_REF(map_propagate_test_wrapper) x)
- : Base(boost::move(static_cast<Base&>(x)))
- {}
-
- map_propagate_test_wrapper &operator=(BOOST_COPY_ASSIGN_REF(map_propagate_test_wrapper) x)
- { this->Base::operator=(x); return *this; }
-
- map_propagate_test_wrapper &operator=(BOOST_RV_REF(map_propagate_test_wrapper) x)
- { this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
-
- void swap(map_propagate_test_wrapper &x)
- { this->Base::swap(x); }
-};
-
-
template<class VoidAllocator, boost::container::tree_type_enum tree_type_value>
struct GetAllocatorMap
{
@@ -356,37 +318,36 @@ int test_map_variants()
return 0;
}
-template<typename MapType>
-bool test_support_for_initialization_list_for()
+struct boost_container_map;
+struct boost_container_multimap;
+
+namespace boost { namespace container { namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_map>
{
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- const std::initializer_list<std::pair<const int, int>> il
- = {std::make_pair(1, 2), std::make_pair(3, 4)};
- const MapType expected(il.begin(), il.end());
+ template <class T, class Allocator>
+ struct apply
{
- const MapType sil = il;
- if (sil != expected)
- return false;
-
- const MapType sil_ordered(ordered_unique_range, il);
- if(sil_ordered != expected)
- return false;
-
- MapType sil_assign = {std::make_pair(99, 100)};
- sil_assign = il;
- if(sil_assign != expected)
- return false;
- }
+ typedef typename boost::container::allocator_traits<Allocator>::
+ template portable_rebind_alloc<std::pair<const T, T> >::type TypeAllocator;
+ typedef boost::container::map<T, T, std::less<T>, TypeAllocator> type;
+ };
+};
+
+template<>
+struct alloc_propagate_base<boost_container_multimap>
+{
+ template <class T, class Allocator>
+ struct apply
{
- MapType sil;
- sil.insert(il);
- if(sil != expected)
- return false;
- }
- return true;
-#endif
- return true;
-}
+ typedef typename boost::container::allocator_traits<Allocator>::
+ template portable_rebind_alloc<std::pair<const T, T> >::type TypeAllocator;
+ typedef boost::container::multimap<T, T, std::less<T>, TypeAllocator> type;
+ };
+};
+
+}}} //namespace boost::container::test
int main ()
{
@@ -397,8 +358,8 @@ int main ()
}
//Allocator argument container
{
- map<int, int> map_((std::allocator<std::pair<const int, int> >()));
- multimap<int, int> multimap_((std::allocator<std::pair<const int, int> >()));
+ map<int, int> map_((map<int, int>::allocator_type()));
+ multimap<int, int> multimap_((multimap<int, int>::allocator_type()));
}
//Now test move semantics
{
@@ -461,13 +422,16 @@ int main ()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<map_propagate_test_wrapper>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_map>())
+ return 1;
+
+ if(!boost::container::test::test_propagate_allocator<boost_container_multimap>())
return 1;
- if(!test_support_for_initialization_list_for<map<int, int> >())
+ if (!boost::container::test::test_map_support_for_initialization_list_for<map<int, int> >())
return 1;
- if(!test_support_for_initialization_list_for<multimap<int, int> >())
+ if (!boost::container::test::test_map_support_for_initialization_list_for<multimap<int, int> >())
return 1;
////////////////////////////////////
diff --git a/libs/container/test/map_test.hpp b/libs/container/test/map_test.hpp
index 83f1cfbf5..79504d998 100644
--- a/libs/container/test/map_test.hpp
+++ b/libs/container/test/map_test.hpp
@@ -13,23 +13,23 @@
#include <boost/container/detail/config_begin.hpp>
#include "check_equal_containers.hpp"
-#include <map>
-#include <functional>
-#include <utility>
#include "print_container.hpp"
-#include <boost/container/detail/utilities.hpp>
#include <boost/container/detail/pair.hpp>
#include <boost/move/iterator.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/move/make_unique.hpp>
+
+#include <boost/intrusive/detail/minimal_pair_header.hpp> //pair
#include <string>
+#include <iostream>
+
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost { namespace container { namespace test {
-#include <boost/intrusive/detail/has_member_function_callable_with.hpp>
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME rebalance
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace boost { namespace container { namespace test {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
+BOOST_INTRUSIVE_HAS_MEMBER_FUNC_CALLED(has_member_rebalance, rebalance)
+
+}}}
template<class T1, class T2, class T3, class T4>
bool operator ==(std::pair<T1, T2> &p1, std::pair<T1, T2> &p2)
@@ -133,6 +133,80 @@ int map_test()
typedef container_detail::pair<IntType, IntType> IntPairType;
typedef typename MyStdMap::value_type StdPairType;
const int max = 50;
+ typedef typename MyStdMap::value_type StdValueType;
+ typedef typename MyStdMap::key_type StdKeyType;
+ typedef typename MyStdMap::mapped_type StdMappedType;
+
+
+ //Test construction from a range
+ {
+ IntPairType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i/2);
+ IntType i2(i/2);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ StdValueType aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ new(&aux_vect2[i])StdValueType(StdKeyType(i/2), StdMappedType(i/2));
+ }
+
+ IntPairType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i/2);
+ IntType i2(i/2);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ ::boost::movelib::unique_ptr<MyBoostMap> const pboostmap = ::boost::movelib::make_unique<MyBoostMap>
+ ( boost::make_move_iterator(&aux_vect[0])
+ , boost::make_move_iterator(&aux_vect[0] + 50), typename MyBoostMap::key_compare());
+ ::boost::movelib::unique_ptr<MyStdMap> const pstdmap = ::boost::movelib::make_unique<MyStdMap>
+ (&aux_vect2[0], &aux_vect2[0] + 50, typename MyStdMap::key_compare());
+ if(!CheckEqualContainers(*pboostmap, *pstdmap)) return 1;
+
+ ::boost::movelib::unique_ptr<MyBoostMultiMap> const pboostmultimap = ::boost::movelib::make_unique<MyBoostMultiMap>
+ ( boost::make_move_iterator(&aux_vect3[0])
+ , boost::make_move_iterator(&aux_vect3[0] + 50), typename MyBoostMap::key_compare());
+ ::boost::movelib::unique_ptr<MyStdMultiMap> const pstdmultimap = ::boost::movelib::make_unique<MyStdMultiMap>
+ (&aux_vect2[0], &aux_vect2[0] + 50, typename MyStdMap::key_compare());
+ if(!CheckEqualContainers(*pboostmultimap, *pstdmultimap)) return 1;
+ }
+ {
+ IntPairType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i/2);
+ IntType i2(i/2);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ StdValueType aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ new(&aux_vect2[i])StdValueType(StdKeyType(i/2), StdMappedType(i/2));
+ }
+
+ IntPairType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i/2);
+ IntType i2(i/2);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ ::boost::movelib::unique_ptr<MyBoostMap> const pboostmap = ::boost::movelib::make_unique<MyBoostMap>
+ ( boost::make_move_iterator(&aux_vect[0])
+ , boost::make_move_iterator(&aux_vect[0] + 50), typename MyBoostMap::allocator_type());
+ ::boost::movelib::unique_ptr<MyStdMap> const pstdmap = ::boost::movelib::make_unique<MyStdMap>
+ (&aux_vect2[0], &aux_vect2[0] + 50, typename MyStdMap::key_compare());
+ if(!CheckEqualContainers(*pboostmap, *pstdmap)) return 1;
+
+ ::boost::movelib::unique_ptr<MyBoostMultiMap> const pboostmultimap = ::boost::movelib::make_unique<MyBoostMultiMap>
+ ( boost::make_move_iterator(&aux_vect3[0])
+ , boost::make_move_iterator(&aux_vect3[0] + 50), typename MyBoostMap::allocator_type());
+ ::boost::movelib::unique_ptr<MyStdMultiMap> const pstdmultimap = ::boost::movelib::make_unique<MyStdMultiMap>
+ (&aux_vect2[0], &aux_vect2[0] + 50, typename MyStdMap::key_compare());
+ if(!CheckEqualContainers(*pboostmultimap, *pstdmultimap)) return 1;
+ }
::boost::movelib::unique_ptr<MyBoostMap> const pboostmap = ::boost::movelib::make_unique<MyBoostMap>();
::boost::movelib::unique_ptr<MyStdMap> const pstdmap = ::boost::movelib::make_unique<MyStdMap>();
@@ -143,7 +217,6 @@ int map_test()
MyBoostMultiMap &boostmultimap = *pboostmultimap;
MyStdMultiMap &stdmultimap = *pstdmultimap;
- //Test construction from a range
{
//This is really nasty, but we have no other simple choice
IntPairType aux_vect[50];
@@ -206,6 +279,20 @@ int map_test()
if(!CheckEqualContainers(boostmap2, stdmap2)) return 1;
if(!CheckEqualContainers(boostmultimap2, stdmultimap2)) return 1;
+ //some comparison operators
+ if(!(boostmap2 == boostmap2))
+ return 1;
+ if(boostmap2 != boostmap2)
+ return 1;
+ if(boostmap2 < boostmap2)
+ return 1;
+ if(boostmap2 > boostmap2)
+ return 1;
+ if(!(boostmap2 <= boostmap2))
+ return 1;
+ if(!(boostmap2 >= boostmap2))
+ return 1;
+
::boost::movelib::unique_ptr<MyBoostMap> const pboostmap3 = ::boost::movelib::make_unique<MyBoostMap>
( boost::make_move_iterator(&aux_vect[0])
, boost::make_move_iterator(&aux_vect[0] + 50));
@@ -492,8 +579,8 @@ int map_test()
std::pair<typename MyStdMultiMap::iterator, typename MyStdMultiMap::iterator> sret =
stdmultimap.equal_range(stdmultimap.begin()->first);
- if( std::distance(bret.first, bret.second) !=
- std::distance(sret.first, sret.second) ){
+ if( boost::container::iterator_distance(bret.first, bret.second) !=
+ boost::container::iterator_distance(sret.first, sret.second) ){
return 1;
}
}
@@ -520,13 +607,13 @@ int map_test()
return 1;
map_test_rebalanceable(boostmap
- , container_detail::bool_<has_member_function_callable_with_rebalance<MyBoostMap>::value>());
+ , container_detail::bool_<has_member_rebalance<MyBoostMap>::value>());
if(!CheckEqualContainers(boostmap, stdmap)){
std::cout << "Error in boostmap.rebalance()" << std::endl;
return 1;
}
map_test_rebalanceable(boostmultimap
- , container_detail::bool_<has_member_function_callable_with_rebalance<MyBoostMultiMap>::value>());
+ , container_detail::bool_<has_member_rebalance<MyBoostMap>::value>());
if(!CheckEqualContainers(boostmultimap, stdmultimap)){
std::cout << "Error in boostmultimap.rebalance()" << std::endl;
return 1;
@@ -577,6 +664,48 @@ int map_test()
return 0;
}
+template<typename MapType>
+bool test_map_support_for_initialization_list_for()
+{
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+ const std::initializer_list<std::pair<typename MapType::value_type::first_type, typename MapType::mapped_type>> il
+ = { std::make_pair(1, 2), std::make_pair(3, 4) };
+
+ const MapType expected(il.begin(), il.end());
+ {
+ const MapType sil = il;
+ if (sil != expected)
+ return false;
+
+ MapType sila(il, typename MapType::allocator_type());
+ if (sila != expected)
+ return false;
+
+ MapType silca(il, typename MapType::key_compare(), typename MapType::allocator_type());
+ if (silca != expected)
+ return false;
+
+ const MapType sil_ordered(ordered_unique_range, il);
+ if (sil_ordered != expected)
+ return false;
+
+ MapType sil_assign = { std::make_pair(99, 100) };
+ sil_assign = il;
+ if (sil_assign != expected)
+ return false;
+ }
+ {
+ MapType sil;
+ sil.insert(il);
+ if (sil != expected)
+ return false;
+ }
+ return true;
+#endif
+ return true;
+}
+
+
} //namespace test{
} //namespace container {
} //namespace boost{
diff --git a/libs/container/test/null_iterators_test.cpp b/libs/container/test/null_iterators_test.cpp
index 7bf4b8199..faf60be13 100644
--- a/libs/container/test/null_iterators_test.cpp
+++ b/libs/container/test/null_iterators_test.cpp
@@ -19,17 +19,16 @@
#include <boost/container/set.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/container/flat_map.hpp>
-#include <boost/intrusive/detail/memory_util.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
#include <boost/core/lightweight_test.hpp>
-#include <boost/aligned_storage.hpp>
#include <boost/static_assert.hpp>
#include <cstring>
#include <new>
using namespace boost::container;
-typedef boost::aligned_storage<sizeof(void*)*4>::type buffer_t;
+typedef boost::container::container_detail::aligned_storage<sizeof(void*)*4>::type buffer_t;
static buffer_t buffer_0x00;
static buffer_t buffer_0xFF;
diff --git a/libs/container/test/print_container.hpp b/libs/container/test/print_container.hpp
index afc07f69a..2e49ec60e 100644
--- a/libs/container/test/print_container.hpp
+++ b/libs/container/test/print_container.hpp
@@ -12,33 +12,12 @@
#define BOOST_PRINTCONTAINER_HPP
#include <boost/container/detail/config_begin.hpp>
-#include <functional>
#include <iostream>
-#include <algorithm>
namespace boost{
namespace container {
namespace test{
-struct PrintValues
-{
- typedef int argument_type;
- typedef void result_type;
-
- void operator() (int value) const
- {
- std::cout << value << " ";
- }
-};
-
-template<class Container>
-void PrintContents(const Container &cont, const char *contName)
-{
- std::cout<< "Printing contents of " << contName << std::endl;
- std::for_each(cont.begin(), cont.end(), PrintValues());
- std::cout<< std::endl << std::endl;
-}
-
//Function to dump data
template<class MyBoostCont
,class MyStdCont>
diff --git a/libs/container/test/propagate_allocator_test.hpp b/libs/container/test/propagate_allocator_test.hpp
index 67138892b..aefda7658 100644
--- a/libs/container/test/propagate_allocator_test.hpp
+++ b/libs/container/test/propagate_allocator_test.hpp
@@ -20,81 +20,193 @@ namespace boost{
namespace container {
namespace test{
-template<template<class, class> class ContainerWrapper>
-bool test_propagate_allocator()
+template<class Selector>
+struct alloc_propagate_base;
+
+template<class T, class Allocator, class Selector>
+class alloc_propagate_wrapper
+ : public alloc_propagate_base<Selector>::template apply<T, Allocator>::type
{
- {
- typedef propagation_test_allocator<char, true, true, true, true> AlwaysPropagate;
- typedef ContainerWrapper<char, AlwaysPropagate> PropagateCont;
+ BOOST_COPYABLE_AND_MOVABLE(alloc_propagate_wrapper)
- //////////////////////////////////////////
- //Test AlwaysPropagate allocator propagation
- //////////////////////////////////////////
- AlwaysPropagate::reset_unique_id();
+ public:
+ typedef typename alloc_propagate_base
+ <Selector>::template apply<T, Allocator>::type Base;
- //default constructor
- PropagateCont c;
- BOOST_TEST (c.get_stored_allocator().id_ == 0);
- BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
- BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
- BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
- BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
+ typedef typename Base::allocator_type allocator_type;
+ typedef typename Base::value_type value_type;
+ typedef typename Base::size_type size_type;
- //copy constructor
- PropagateCont c2(c);
- //propagate_on_copy_constructor produces copies, moves or RVO (depending on the compiler).
- //For allocators that copy in select_on_container_copy_construction, at least we must have a copy
- unsigned int ctr_copies = c2.get_stored_allocator().ctr_copies_;
- unsigned int ctr_moves = c2.get_stored_allocator().ctr_moves_;
- BOOST_TEST (c2.get_stored_allocator().id_ == 0);
- BOOST_TEST (ctr_copies > 0);
- BOOST_TEST (c2.get_stored_allocator().ctr_moves_ >= 0);
- BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
- BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ alloc_propagate_wrapper()
+ : Base()
+ {}
- //move constructor
- PropagateCont c3(boost::move(c2));
- BOOST_TEST (c3.get_stored_allocator().id_ == 0);
- BOOST_TEST (c3.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c3.get_stored_allocator().ctr_moves_ > ctr_moves);
- ctr_moves = c3.get_stored_allocator().ctr_moves_;
- BOOST_TEST (ctr_moves > 0);
- BOOST_TEST (c3.get_stored_allocator().assign_copies_ == 0);
- BOOST_TEST (c3.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c3.get_stored_allocator().swaps_ == 0);
-
- //copy assign
- c2 = c3;
- unsigned int assign_copies = c2.get_stored_allocator().assign_copies_;
- BOOST_TEST (c2.get_stored_allocator().id_ == 0);
- BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == ctr_moves);
- BOOST_TEST (assign_copies == 1);
- BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ explicit alloc_propagate_wrapper(const allocator_type &a)
+ : Base(a)
+ {}
+/*
+ //sequence containers only
+ explicit alloc_propagate_wrapper(size_type n, const value_type &v, const allocator_type &a)
+ : Base(n, v, a)
+ {}
- //move assign
- c = boost::move(c2);
- unsigned int assign_moves = c.get_stored_allocator().assign_moves_;
- BOOST_TEST (c.get_stored_allocator().id_ == 0);
- BOOST_TEST (c.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c.get_stored_allocator().ctr_moves_ == ctr_moves);
- BOOST_TEST (c.get_stored_allocator().assign_copies_ == assign_copies);
- BOOST_TEST (assign_moves == 1);
- BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
+ alloc_propagate_wrapper(size_type n, const allocator_type &a)
+ : Base(n, a)
+ {}*/
+
+ template<class Iterator>
+ alloc_propagate_wrapper(Iterator b, Iterator e, const allocator_type &a)
+ : Base(b, e, a)
+ {}
+
+ #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+ alloc_propagate_wrapper(std::initializer_list<value_type> il, const allocator_type& a)
+ : Base(il, a)
+ {}
+/*
+ //associative containers only
+ alloc_propagate_wrapper(std::initializer_list<value_type> il, const Compare& comp, const allocator_type& a)
+ : Base(il, comp, a)
+ {}*/
+
+ #endif
+
+ alloc_propagate_wrapper(const alloc_propagate_wrapper &x)
+ : Base(x)
+ {}
+
+ alloc_propagate_wrapper(const alloc_propagate_wrapper &x, const allocator_type &a)
+ : Base(x, a)
+ {}
+
+ alloc_propagate_wrapper(BOOST_RV_REF(alloc_propagate_wrapper) x)
+ : Base(boost::move(static_cast<Base&>(x)))
+ {}
+
+ alloc_propagate_wrapper(BOOST_RV_REF(alloc_propagate_wrapper) x, const allocator_type &a)
+ : Base(boost::move(static_cast<Base&>(x)), a)
+ {}
+
+ alloc_propagate_wrapper &operator=(BOOST_COPY_ASSIGN_REF(alloc_propagate_wrapper) x)
+ { this->Base::operator=(x); return *this; }
+
+ alloc_propagate_wrapper &operator=(BOOST_RV_REF(alloc_propagate_wrapper) x)
+ { this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
+
+ void swap(alloc_propagate_wrapper &x)
+ { this->Base::swap(x); }
+};
+
+template<class T>
+struct get_real_stored_allocator
+{
+ typedef typename T::stored_allocator_type type;
+};
+
+template<class Container>
+void test_propagate_allocator_allocator_arg();
- //swap
- c.get_stored_allocator().id_ = 999;
- c.swap(c2);
- unsigned int swaps = c2.get_stored_allocator().swaps_;
- BOOST_TEST (c2.get_stored_allocator().id_ == 999);
- BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == ctr_moves);
- BOOST_TEST (c2.get_stored_allocator().assign_copies_ == assign_copies);
- BOOST_TEST (c2.get_stored_allocator().assign_moves_ == assign_moves);
- BOOST_TEST (swaps == 1);
+template<class Selector>
+bool test_propagate_allocator()
+{
+ {
+ typedef propagation_test_allocator<char, true, true, true, true> AlwaysPropagate;
+ typedef alloc_propagate_wrapper<char, AlwaysPropagate, Selector> PropagateCont;
+ typedef typename get_real_stored_allocator<typename PropagateCont::Base>::type StoredAllocator;
+ {
+ //////////////////////////////////////////
+ //Test AlwaysPropagate allocator propagation
+ //////////////////////////////////////////
+
+ //default constructor
+ StoredAllocator::reset_unique_id(111);
+ PropagateCont c; //stored 112
+ BOOST_TEST (c.get_stored_allocator().id_ == 112);
+ BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //copy constructor
+ StoredAllocator::reset_unique_id(222);
+ PropagateCont c; //stored 223
+ BOOST_TEST (c.get_stored_allocator().id_ == 223);
+ //propagate_on_copy_constructor produces copies, moves or RVO (depending on the compiler).
+ //For allocators that copy in select_on_container_copy_construction, at least we must have a copy
+ PropagateCont c2(c); //should propagate 223
+ BOOST_TEST (c2.get_stored_allocator().id_ == 223);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ >= 1);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ >= 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //move constructor
+ StoredAllocator::reset_unique_id(333);
+ PropagateCont c; //stored 334
+ BOOST_TEST (c.get_stored_allocator().id_ == 334);
+ PropagateCont c2(boost::move(c)); //should propagate 334
+ BOOST_TEST (c2.get_stored_allocator().id_ == 334);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ > 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //copy assign
+ StoredAllocator::reset_unique_id(444);
+ PropagateCont c; //stored 445
+ BOOST_TEST (c.get_stored_allocator().id_ == 445);
+ PropagateCont c2; //stored 446
+ BOOST_TEST (c2.get_stored_allocator().id_ == 446);
+ c2 = c; //should propagate 445
+ BOOST_TEST (c2.get_stored_allocator().id_ == 445);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 1);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //move assign
+ StoredAllocator::reset_unique_id(555);
+ PropagateCont c; //stored 556
+ BOOST_TEST (c.get_stored_allocator().id_ == 556);
+ PropagateCont c2; //stored 557
+ BOOST_TEST (c2.get_stored_allocator().id_ == 557);
+ c = boost::move(c2); //should propagate 557
+ BOOST_TEST (c.get_stored_allocator().id_ == 557);
+ BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_moves_ == 1);
+ BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //swap
+ StoredAllocator::reset_unique_id(666);
+ PropagateCont c; //stored 667
+ BOOST_TEST (c.get_stored_allocator().id_ == 667);
+ PropagateCont c2; //stored 668
+ BOOST_TEST (c2.get_stored_allocator().id_ == 668);
+ c.swap(c2);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 1);
+ BOOST_TEST (c.get_stored_allocator().swaps_ == 1);
+ }
+ //And now allocator argument constructors
+ test_propagate_allocator_allocator_arg<PropagateCont>();
}
//////////////////////////////////////////
@@ -102,74 +214,149 @@ bool test_propagate_allocator()
//////////////////////////////////////////
{
typedef propagation_test_allocator<char, false, false, false, false> NeverPropagate;
- typedef ContainerWrapper<char, NeverPropagate> NoPropagateCont;
- NeverPropagate::reset_unique_id();
+ typedef alloc_propagate_wrapper<char, NeverPropagate, Selector> NoPropagateCont;
+ typedef typename get_real_stored_allocator<typename NoPropagateCont::Base>::type StoredAllocator;
+ {
+ //default constructor
+ StoredAllocator::reset_unique_id(111);
+ NoPropagateCont c; //stored 112
+ BOOST_TEST (c.get_stored_allocator().id_ == 112);
+ BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //copy constructor
+ //propagate_on_copy_constructor produces copies, moves or RVO (depending on the compiler)
+ //For allocators that don't copy in select_on_container_copy_construction we must have a default
+ //construction
+ StoredAllocator::reset_unique_id(222);
+ NoPropagateCont c; //stored 223
+ BOOST_TEST (c.get_stored_allocator().id_ == 223);
+ NoPropagateCont c2(c); //should NOT propagate 223
+ BOOST_TEST (c2.get_stored_allocator().id_ == 224);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ >= 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ >= 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //move constructor
+ StoredAllocator::reset_unique_id(333);
+ NoPropagateCont c; //stored 334
+ BOOST_TEST (c.get_stored_allocator().id_ == 334);
+ NoPropagateCont c2(boost::move(c)); // should NOT propagate 334
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ >= 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ >= 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //copy assign
+ StoredAllocator::reset_unique_id(444);
+ NoPropagateCont c; //stored 445
+ NoPropagateCont c2; //stored 446
+ c2 = c; // should NOT propagate 445
+ BOOST_TEST (c2.get_stored_allocator().id_ == 446);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //move assign
+ StoredAllocator::reset_unique_id(555);
+ NoPropagateCont c; //stored 556
+ NoPropagateCont c2; //stored 557
+ c2 = c; // should NOT propagate 556
+ BOOST_TEST (c2.get_stored_allocator().id_ == 557);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ }
+ {
+ //swap
+ StoredAllocator::reset_unique_id(666);
+ NoPropagateCont c; //stored 667
+ BOOST_TEST (c.get_stored_allocator().id_ == 667);
+ NoPropagateCont c2; //stored 668
+ BOOST_TEST (c2.get_stored_allocator().id_ == 668);
+ c2.swap(c); // should NOT swap 667 and 668
+ BOOST_TEST (c2.get_stored_allocator().id_ == 668);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
+ BOOST_TEST (c.get_stored_allocator().id_ == 667);
+ BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
+ BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
+ BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
+ }
+ //And now allocator argument constructors
+ test_propagate_allocator_allocator_arg<NoPropagateCont>();
+ }
- //default constructor
- NoPropagateCont c;
- BOOST_TEST (c.get_stored_allocator().id_ == 0);
- BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
+ return report_errors() == 0;
+}
+
+template<class Container>
+void test_propagate_allocator_allocator_arg()
+{
+ typedef typename Container::allocator_type allocator_type;
+ typedef typename get_real_stored_allocator<typename Container::Base>::type StoredAllocator;
+
+ { //The allocator must be always propagated
+ //allocator constructor
+ allocator_type::reset_unique_id(111);
+ const allocator_type & a = allocator_type(); //stored 112
+ Container c(a); //should propagate 112
+ BOOST_TEST (c.get_stored_allocator().id_ == 112);
+ BOOST_TEST (c.get_stored_allocator().ctr_copies_ > 0);
BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
-
- //copy constructor
- //propagate_on_copy_constructor produces copies, moves or RVO (depending on the compiler)
- //For allocators that don't copy in select_on_container_copy_construction we must have a default
- //construction
- NoPropagateCont c2(c);
- unsigned int ctr_copies = c2.get_stored_allocator().ctr_copies_;
- unsigned int ctr_moves = c2.get_stored_allocator().ctr_moves_;
- BOOST_TEST (c2.get_stored_allocator().id_ == 1);
- BOOST_TEST (ctr_copies >= 0);
- BOOST_TEST (ctr_moves >= 0);
- BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
- BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
-
- //move constructor
- NoPropagateCont c3(boost::move(c2));
- BOOST_TEST (c3.get_stored_allocator().id_ == 1);
- BOOST_TEST (c3.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c3.get_stored_allocator().ctr_moves_ > ctr_moves);
- unsigned int ctr_moves2 = ctr_moves;
- ctr_moves = c3.get_stored_allocator().ctr_moves_;
- BOOST_TEST (c3.get_stored_allocator().assign_copies_ == 0);
- BOOST_TEST (c3.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c3.get_stored_allocator().swaps_ == 0);
-
- //copy assign
- c2 = c3;
- BOOST_TEST (c2.get_stored_allocator().id_ == 1);
- BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == ctr_moves2);
+ }
+ {
+ //copy allocator constructor
+ StoredAllocator::reset_unique_id(999);
+ Container c;
+ //stored_allocator_type could be the same type as allocator_type
+ //so reset it again to get a predictable result
+ allocator_type::reset_unique_id(222);
+ Container c2(c, allocator_type()); //should propagate 223
+ BOOST_TEST (c2.get_stored_allocator().id_ == 223);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ > 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
-
- //move assign
- c = boost::move(c2);
- BOOST_TEST (c.get_stored_allocator().id_ == 0);
- BOOST_TEST (c.get_stored_allocator().ctr_copies_ == 0);
- BOOST_TEST (c.get_stored_allocator().ctr_moves_ == 0);
- BOOST_TEST (c.get_stored_allocator().assign_copies_ == 0);
- BOOST_TEST (c.get_stored_allocator().assign_moves_ == 0);
- BOOST_TEST (c.get_stored_allocator().swaps_ == 0);
-
- //swap
- c.get_stored_allocator().id_ = 999;
- c2.swap(c);
- BOOST_TEST (c2.get_stored_allocator().id_ == 1);
- BOOST_TEST (c.get_stored_allocator().id_ == 999);
- BOOST_TEST (c2.get_stored_allocator().ctr_copies_ == ctr_copies);
- BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == ctr_moves2);
+ }
+ {
+ //move allocator constructor
+ StoredAllocator::reset_unique_id(999);
+ Container c;
+ //stored_allocator_type could be the same type as allocator_type
+ //so reset it again to get a predictable result
+ allocator_type::reset_unique_id(333);
+ Container c2(boost::move(c), allocator_type()); //should propagate 334
+ BOOST_TEST (c2.get_stored_allocator().id_ == 334);
+ BOOST_TEST (c2.get_stored_allocator().ctr_copies_ > 0);
+ BOOST_TEST (c2.get_stored_allocator().ctr_moves_ == 0);
BOOST_TEST (c2.get_stored_allocator().assign_copies_ == 0);
BOOST_TEST (c2.get_stored_allocator().assign_moves_ == 0);
BOOST_TEST (c2.get_stored_allocator().swaps_ == 0);
}
-
- return report_errors() == 0;
}
} //namespace test{
diff --git a/libs/container/test/scoped_allocator_adaptor_test.cpp b/libs/container/test/scoped_allocator_adaptor_test.cpp
index dadeba66b..04b7f8103 100644
--- a/libs/container/test/scoped_allocator_adaptor_test.cpp
+++ b/libs/container/test/scoped_allocator_adaptor_test.cpp
@@ -9,15 +9,19 @@
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/scoped_allocator_fwd.hpp>
-#include <boost/container/detail/utilities.hpp>
-#include <cstddef>
+
+// container/detail
#include <boost/container/detail/mpl.hpp>
+// move
#include <boost/move/utility_core.hpp>
+#include <boost/move/adl_move_swap.hpp>
+// std
#include <memory>
+#include <cstddef>
using namespace boost::container;
-template<class T, unsigned int Id, bool Propagate = false>
+template<class T, unsigned int Id, bool HasTrueTypes = false>
class test_allocator
{
BOOST_COPYABLE_AND_MOVABLE(test_allocator)
@@ -26,12 +30,13 @@ class test_allocator
template<class U>
struct rebind
{
- typedef test_allocator<U, Id, Propagate> other;
+ typedef test_allocator<U, Id, HasTrueTypes> other;
};
- typedef container_detail::bool_<Propagate> propagate_on_container_copy_assignment;
- typedef container_detail::bool_<Propagate> propagate_on_container_move_assignment;
- typedef container_detail::bool_<Propagate> propagate_on_container_swap;
+ typedef container_detail::bool_<HasTrueTypes> propagate_on_container_copy_assignment;
+ typedef container_detail::bool_<HasTrueTypes> propagate_on_container_move_assignment;
+ typedef container_detail::bool_<HasTrueTypes> propagate_on_container_swap;
+ typedef container_detail::bool_<HasTrueTypes> is_always_equal;
typedef T value_type;
test_allocator()
@@ -47,12 +52,12 @@ class test_allocator
{}
template<class U>
- test_allocator(BOOST_RV_REF_BEG test_allocator<U, Id, Propagate> BOOST_RV_REF_END)
+ test_allocator(BOOST_RV_REF_BEG test_allocator<U, Id, HasTrueTypes> BOOST_RV_REF_END)
: m_move_contructed(true), m_move_assigned(false)
{}
template<class U>
- test_allocator(const test_allocator<U, Id, Propagate> &)
+ test_allocator(const test_allocator<U, Id, HasTrueTypes> &)
{}
test_allocator & operator=(BOOST_COPY_ASSIGN_REF(test_allocator))
@@ -79,14 +84,14 @@ class test_allocator
bool m_move_assigned;
};
-template <class T1, class T2, unsigned int Id, bool Propagate>
-bool operator==( const test_allocator<T1, Id, Propagate>&
- , const test_allocator<T2, Id, Propagate>&)
+template <class T1, class T2, unsigned int Id, bool HasTrueTypes>
+bool operator==( const test_allocator<T1, Id, HasTrueTypes>&
+ , const test_allocator<T2, Id, HasTrueTypes>&)
{ return true; }
-template <class T1, class T2, unsigned int Id, bool Propagate>
-bool operator!=( const test_allocator<T1, Id, Propagate>&
- , const test_allocator<T2, Id, Propagate>&)
+template <class T1, class T2, unsigned int Id, bool HasTrueTypes>
+bool operator!=( const test_allocator<T1, Id, HasTrueTypes>&
+ , const test_allocator<T2, Id, HasTrueTypes>&)
{ return false; }
@@ -236,21 +241,22 @@ namespace container {
template<unsigned int AllocatorTag>
struct constructible_with_allocator_prefix
< ::mark_on_scoped_allocation<ConstructiblePrefix, AllocatorTag> >
- : ::boost::true_type
-{};
+{
+ static const bool value = true;
+};
template<unsigned int AllocatorTag>
struct constructible_with_allocator_suffix
< ::mark_on_scoped_allocation<ConstructibleSuffix, AllocatorTag> >
- : ::boost::true_type
-{};
+{
+ static const bool value = true;
+};
} //namespace container {
} //namespace boost {
#include <boost/container/scoped_allocator.hpp>
-#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
#include <boost/container/vector.hpp>
#include <boost/container/detail/pair.hpp>
@@ -264,12 +270,12 @@ int main()
typedef test_allocator<tagged_integer<2>, 2> InnerAlloc2;
typedef test_allocator<tagged_integer<1>, 11> Inner11IdAlloc1;
- typedef test_allocator<tagged_integer<0>, 0, false> OuterAllocFalsePropagate;
- typedef test_allocator<tagged_integer<0>, 0, true> OuterAllocTruePropagate;
- typedef test_allocator<tagged_integer<1>, 1, false> InnerAlloc1FalsePropagate;
- typedef test_allocator<tagged_integer<1>, 1, true> InnerAlloc1TruePropagate;
- typedef test_allocator<tagged_integer<2>, 2, false> InnerAlloc2FalsePropagate;
- typedef test_allocator<tagged_integer<2>, 2, true> InnerAlloc2TruePropagate;
+ typedef test_allocator<tagged_integer<0>, 0, false> OuterAllocFalseHasTrueTypes;
+ typedef test_allocator<tagged_integer<0>, 0, true> OuterAllocTrueHasTrueTypes;
+ typedef test_allocator<tagged_integer<1>, 1, false> InnerAlloc1FalseHasTrueTypes;
+ typedef test_allocator<tagged_integer<1>, 1, true> InnerAlloc1TrueHasTrueTypes;
+ typedef test_allocator<tagged_integer<2>, 2, false> InnerAlloc2FalseHasTrueTypes;
+ typedef test_allocator<tagged_integer<2>, 2, true> InnerAlloc2TrueHasTrueTypes;
//
typedef scoped_allocator_adaptor< OuterAlloc > Scoped0Inner;
@@ -374,40 +380,40 @@ int main()
{
//Propagation test
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate > Scoped0InnerF;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate > Scoped0InnerT;
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate
- , InnerAlloc1FalsePropagate > Scoped1InnerFF;
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate
- , InnerAlloc1TruePropagate > Scoped1InnerFT;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate
- , InnerAlloc1FalsePropagate > Scoped1InnerTF;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate
- , InnerAlloc1TruePropagate > Scoped1InnerTT;
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate
- , InnerAlloc1FalsePropagate
- , InnerAlloc2FalsePropagate > Scoped2InnerFFF;
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate
- , InnerAlloc1FalsePropagate
- , InnerAlloc2TruePropagate > Scoped2InnerFFT;
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate
- , InnerAlloc1TruePropagate
- , InnerAlloc2FalsePropagate > Scoped2InnerFTF;
- typedef scoped_allocator_adaptor< OuterAllocFalsePropagate
- , InnerAlloc1TruePropagate
- , InnerAlloc2TruePropagate > Scoped2InnerFTT;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate
- , InnerAlloc1FalsePropagate
- , InnerAlloc2FalsePropagate > Scoped2InnerTFF;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate
- , InnerAlloc1FalsePropagate
- , InnerAlloc2TruePropagate > Scoped2InnerTFT;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate
- , InnerAlloc1TruePropagate
- , InnerAlloc2FalsePropagate > Scoped2InnerTTF;
- typedef scoped_allocator_adaptor< OuterAllocTruePropagate
- , InnerAlloc1TruePropagate
- , InnerAlloc2TruePropagate > Scoped2InnerTTT;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes > Scoped0InnerF;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes > Scoped0InnerT;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes
+ , InnerAlloc1FalseHasTrueTypes > Scoped1InnerFF;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes
+ , InnerAlloc1TrueHasTrueTypes > Scoped1InnerFT;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes
+ , InnerAlloc1FalseHasTrueTypes > Scoped1InnerTF;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes
+ , InnerAlloc1TrueHasTrueTypes > Scoped1InnerTT;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes
+ , InnerAlloc1FalseHasTrueTypes
+ , InnerAlloc2FalseHasTrueTypes > Scoped2InnerFFF;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes
+ , InnerAlloc1FalseHasTrueTypes
+ , InnerAlloc2TrueHasTrueTypes > Scoped2InnerFFT;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes
+ , InnerAlloc1TrueHasTrueTypes
+ , InnerAlloc2FalseHasTrueTypes > Scoped2InnerFTF;
+ typedef scoped_allocator_adaptor< OuterAllocFalseHasTrueTypes
+ , InnerAlloc1TrueHasTrueTypes
+ , InnerAlloc2TrueHasTrueTypes > Scoped2InnerFTT;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes
+ , InnerAlloc1FalseHasTrueTypes
+ , InnerAlloc2FalseHasTrueTypes > Scoped2InnerTFF;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes
+ , InnerAlloc1FalseHasTrueTypes
+ , InnerAlloc2TrueHasTrueTypes > Scoped2InnerTFT;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes
+ , InnerAlloc1TrueHasTrueTypes
+ , InnerAlloc2FalseHasTrueTypes > Scoped2InnerTTF;
+ typedef scoped_allocator_adaptor< OuterAllocTrueHasTrueTypes
+ , InnerAlloc1TrueHasTrueTypes
+ , InnerAlloc2TrueHasTrueTypes > Scoped2InnerTTT;
//propagate_on_container_copy_assignment
//0 inner
@@ -465,6 +471,24 @@ int main()
BOOST_STATIC_ASSERT(( Scoped2InnerTFT::propagate_on_container_swap::value ));
BOOST_STATIC_ASSERT(( Scoped2InnerTTF::propagate_on_container_swap::value ));
BOOST_STATIC_ASSERT(( Scoped2InnerTTT::propagate_on_container_swap::value ));
+ //is_always_equal
+ //0 inner
+ BOOST_STATIC_ASSERT(( !Scoped0InnerF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( Scoped0InnerT::is_always_equal::value ));
+ //1 inner
+ BOOST_STATIC_ASSERT(( !Scoped1InnerFF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped1InnerFT::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped1InnerTF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( Scoped1InnerTT::is_always_equal::value ));
+ //2 inner
+ BOOST_STATIC_ASSERT(( !Scoped2InnerFFF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped2InnerFFT::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped2InnerFTF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped2InnerFTT::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped2InnerTFF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped2InnerTFT::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( !Scoped2InnerTTF::is_always_equal::value ));
+ BOOST_STATIC_ASSERT(( Scoped2InnerTTT::is_always_equal::value ));
}
//Default constructor
@@ -475,8 +499,8 @@ int main()
{
Scoped0Inner s0i2;
Scoped1Inner s1i2;
- boost::container::swap_dispatch(s0i, s0i2);
- boost::container::swap_dispatch(s1i, s1i2);
+ boost::adl_move_swap(s0i, s0i2);
+ boost::adl_move_swap(s1i, s1i2);
}
}
diff --git a/libs/container/test/scoped_allocator_usage_test.cpp b/libs/container/test/scoped_allocator_usage_test.cpp
index 111d12a71..61607e7e6 100644
--- a/libs/container/test/scoped_allocator_usage_test.cpp
+++ b/libs/container/test/scoped_allocator_usage_test.cpp
@@ -1,3 +1,12 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2011-2013. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <memory>
@@ -7,6 +16,7 @@
#include <boost/container/list.hpp>
#include <boost/container/slist.hpp>
#include <boost/container/stable_vector.hpp>
+#include <boost/container/small_vector.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/container/map.hpp>
@@ -48,6 +58,12 @@ public:
std::allocator<Ty> m_allocator;
template <typename T> friend class SimpleAllocator;
+
+ friend bool operator == (const SimpleAllocator &, const SimpleAllocator &)
+ { return true; }
+
+ friend bool operator != (const SimpleAllocator &, const SimpleAllocator &)
+ { return false; }
};
class alloc_int
@@ -125,6 +141,7 @@ typedef deque<alloc_int, AllocIntAllocator> Deque;
typedef list<alloc_int, AllocIntAllocator> List;
typedef slist<alloc_int, AllocIntAllocator> Slist;
typedef stable_vector<alloc_int, AllocIntAllocator> StableVector;
+typedef small_vector<alloc_int, 9, AllocIntAllocator> SmallVector;
/////////
//is_unique_assoc
@@ -136,26 +153,26 @@ struct is_unique_assoc
static const bool value = false;
};
-template<class K, class V, class C, class A>
-struct is_unique_assoc< map<K, V, C, A> >
+template<class Key, class T, class Compare, class Allocator>
+struct is_unique_assoc< map<Key, T, Compare, Allocator> >
{
static const bool value = true;
};
-template<class K, class V, class C, class A>
-struct is_unique_assoc< flat_map<K, V, C, A> >
+template<class Key, class T, class Compare, class Allocator>
+struct is_unique_assoc< flat_map<Key, T, Compare, Allocator> >
{
static const bool value = true;
};
-template<class V, class C, class A>
-struct is_unique_assoc< set<V, C, A> >
+template<class Key, class Compare, class Allocator>
+struct is_unique_assoc< set<Key, Compare, Allocator> >
{
static const bool value = true;
};
-template<class V, class C, class A>
-struct is_unique_assoc< flat_set<V, C, A> >
+template<class Key, class Compare, class Allocator>
+struct is_unique_assoc< flat_set<Key, Compare, Allocator> >
{
static const bool value = true;
};
@@ -171,26 +188,26 @@ struct is_map
static const bool value = false;
};
-template<class K, class V, class C, class A>
-struct is_map< map<K, V, C, A> >
+template<class Key, class T, class Compare, class Allocator>
+struct is_map< map<Key, T, Compare, Allocator> >
{
static const bool value = true;
};
-template<class K, class V, class C, class A>
-struct is_map< flat_map<K, V, C, A> >
+template<class Key, class T, class Compare, class Allocator>
+struct is_map< flat_map<Key, T, Compare, Allocator> >
{
static const bool value = true;
};
-template<class K, class V, class C, class A>
-struct is_map< multimap<K, V, C, A> >
+template<class Key, class T, class Compare, class Allocator>
+struct is_map< multimap<Key, T, Compare, Allocator> >
{
static const bool value = true;
};
-template<class K, class V, class C, class A>
-struct is_map< flat_multimap<K, V, C, A> >
+template<class Key, class T, class Compare, class Allocator>
+struct is_map< flat_multimap<Key, T, Compare, Allocator> >
{
static const bool value = true;
};
@@ -201,26 +218,26 @@ struct is_set
static const bool value = false;
};
-template<class V, class C, class A>
-struct is_set< set<V, C, A> >
+template<class Key, class Compare, class Allocator>
+struct is_set< set<Key, Compare, Allocator> >
{
static const bool value = true;
};
-template<class V, class C, class A>
-struct is_set< flat_set<V, C, A> >
+template<class Key, class Compare, class Allocator>
+struct is_set< flat_set<Key, Compare, Allocator> >
{
static const bool value = true;
};
-template<class V, class C, class A>
-struct is_set< multiset<V, C, A> >
+template<class Key, class Compare, class Allocator>
+struct is_set< multiset<Key, Compare, Allocator> >
{
static const bool value = true;
};
-template<class V, class C, class A>
-struct is_set< flat_multiset<V, C, A> >
+template<class Key, class Compare, class Allocator>
+struct is_set< flat_multiset<Key, Compare, Allocator> >
{
static const bool value = true;
};
@@ -229,106 +246,97 @@ struct is_set< flat_multiset<V, C, A> >
//container_wrapper
/////////
+//Try to define-allocator_aware requirements
template< class Container
, bool Assoc = is_set<Container>::value || is_map<Container>::value
, bool UniqueAssoc = is_unique_assoc<Container>::value
, bool Map = is_map<Container>::value
>
-struct container_wrapper
- : public Container
+struct container_wrapper_inserter
{
- typedef typename Container::allocator_type allocator_type;
+ typedef typename Container::const_iterator const_iterator;
+ typedef typename Container::iterator iterator;
- container_wrapper(const allocator_type &a)
- : Container(a)
- {}
+ template<class Arg>
+ static iterator emplace(Container &c, const_iterator p, const Arg &arg)
+ { return c.emplace(p, arg); }
};
template<class Container> //map
-struct container_wrapper<Container, true, true, true>
- : public Container
+struct container_wrapper_inserter<Container, true, true, true>
{
- typedef typename Container::allocator_type allocator_type;
- typedef typename Container::key_compare key_compare;
- typedef typename Container::value_type value_type;
typedef typename Container::const_iterator const_iterator;
typedef typename Container::iterator iterator;
- container_wrapper(const allocator_type &a)
- : Container(key_compare(), a)
- {}
-
template<class Arg>
- iterator emplace(const_iterator, const Arg &arg)
- {
- return this->Container::emplace(arg, arg).first;
- }
+ static iterator emplace(Container &c, const_iterator, const Arg &arg)
+ { return c.emplace(arg, arg).first; }
};
template<class Container> //set
-struct container_wrapper<Container, true, true, false>
- : public Container
+struct container_wrapper_inserter<Container, true, true, false>
{
- typedef typename Container::allocator_type allocator_type;
- typedef typename Container::key_compare key_compare;
- typedef typename Container::value_type value_type;
typedef typename Container::const_iterator const_iterator;
typedef typename Container::iterator iterator;
- container_wrapper(const allocator_type &a)
- : Container(key_compare(), a)
- {}
-
template<class Arg>
- iterator emplace(const_iterator, const Arg &arg)
- {
- return this->Container::emplace(arg).first;
- }
+ static iterator emplace(Container &c, const_iterator, const Arg &arg)
+ { return c.emplace(arg).first; }
};
template<class Container> //multimap
-struct container_wrapper<Container, true, false, true>
- : public Container
+struct container_wrapper_inserter<Container, true, false, true>
{
- typedef typename Container::value_type value_type;
- typedef typename Container::key_compare key_compare;
- typedef typename Container::allocator_type allocator_type;
typedef typename Container::const_iterator const_iterator;
typedef typename Container::iterator iterator;
- container_wrapper(const allocator_type &a)
- : Container(key_compare(), a)
- {}
-
template<class Arg>
- iterator emplace(const_iterator, const Arg &arg)
- {
- return this->Container::emplace(arg, arg);
- }
+ static iterator emplace(Container &c, const_iterator, const Arg &arg)
+ { return c.emplace(arg, arg); }
};
//multiset
template<class Container> //multimap
-struct container_wrapper<Container, true, false, false>
+struct container_wrapper_inserter<Container, true, false, false>
+{
+ typedef typename Container::const_iterator const_iterator;
+ typedef typename Container::iterator iterator;
+
+ template<class Arg>
+ static iterator emplace(Container &c, const_iterator, const Arg &arg)
+ { return c.emplace(arg); }
+};
+
+template< class Container>
+struct container_wrapper
: public Container
{
- typedef typename Container::value_type value_type;
- typedef typename Container::key_compare key_compare;
+ private:
+ BOOST_COPYABLE_AND_MOVABLE(container_wrapper)
+
+ public:
typedef typename Container::allocator_type allocator_type;
typedef typename Container::const_iterator const_iterator;
typedef typename Container::iterator iterator;
container_wrapper(const allocator_type &a)
- : Container(key_compare(), a)
+ : Container(a)
+ {}
+
+ container_wrapper(BOOST_RV_REF(container_wrapper) o, const allocator_type &a)
+ : Container(BOOST_MOVE_BASE(Container, o), a)
+ {}
+
+ container_wrapper(const container_wrapper &o, const allocator_type &a)
+ : Container(o, a)
{}
template<class Arg>
- iterator emplace(const_iterator, const Arg &arg)
- {
- return this->Container::emplace(arg);
- }
+ iterator emplace(const_iterator p, const Arg &arg)
+ { return container_wrapper_inserter<Container>::emplace(*this, p, arg); }
};
+
bool test_value_and_state_equals(const alloc_int &r, int value, int state)
{ return r.get_value() == value && r.get_allocator_state() == state; }
@@ -345,19 +353,42 @@ bool one_level_allocator_propagation_test()
{
typedef container_wrapper<Container> ContainerWrapper;
typedef typename ContainerWrapper::iterator iterator;
- ContainerWrapper c(SimpleAllocator<MapNode>(5));
+ typedef typename ContainerWrapper::allocator_type allocator_type;
+ typedef typename ContainerWrapper::value_type value_type;
+ {
+ ContainerWrapper c(allocator_type(SimpleAllocator<value_type>(5)));
- c.clear();
- iterator it = c.emplace(c.cbegin(), 42);
+ c.clear();
+ iterator it = c.emplace(c.cbegin(), 42);
- if(!test_value_and_state_equals(*it, 42, 5))
- return false;
+ if(!test_value_and_state_equals(*it, 42, 5))
+ return false;
+ }
+ {
+ ContainerWrapper c2(allocator_type(SimpleAllocator<value_type>(4)));
+ ContainerWrapper c(::boost::move(c2), allocator_type(SimpleAllocator<value_type>(5)));
+ c.clear();
+ iterator it = c.emplace(c.cbegin(), 42);
+
+ if(!test_value_and_state_equals(*it, 42, 5))
+ return false;
+ }/*
+ {
+ ContainerWrapper c2(allocator_type(SimpleAllocator<value_type>(3)));
+ ContainerWrapper c(c2, allocator_type(SimpleAllocator<value_type>(5)));
+
+ c.clear();
+ iterator it = c.emplace(c.cbegin(), 42);
+
+ if(!test_value_and_state_equals(*it, 42, 5))
+ return false;
+ }*/
return true;
}
int main()
-{
+{/*
//unique assoc
if(!one_level_allocator_propagation_test<FlatMap>())
return 1;
@@ -375,7 +406,7 @@ int main()
if(!one_level_allocator_propagation_test<FlatMultiSet>())
return 1;
if(!one_level_allocator_propagation_test<MultiSet>())
- return 1;
+ return 1;*/
//sequence containers
if(!one_level_allocator_propagation_test<Vector>())
return 1;
@@ -387,6 +418,8 @@ int main()
return 1;
if(!one_level_allocator_propagation_test<StableVector>())
return 1;
+ if(!one_level_allocator_propagation_test<SmallVector>())
+ return 1;
return 0;
}
diff --git a/libs/container/test/set_test.cpp b/libs/container/test/set_test.cpp
index 4c0be9c4f..b305868de 100644
--- a/libs/container/test/set_test.cpp
+++ b/libs/container/test/set_test.cpp
@@ -176,7 +176,7 @@ public:
set<recursive_set>::const_iterator cit_;
set<recursive_set>::reverse_iterator rit_;
set<recursive_set>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_set &a, const recursive_set &b)
{ return a.id_ < b.id_; }
};
@@ -194,7 +194,7 @@ class recursive_multiset
multiset<recursive_multiset>::const_iterator cit_;
multiset<recursive_multiset>::reverse_iterator rit_;
multiset<recursive_multiset>::const_reverse_iterator crit_;
-
+
friend bool operator< (const recursive_multiset &a, const recursive_multiset &b)
{ return a.id_ < b.id_; }
};
@@ -212,37 +212,35 @@ void test_move()
move_assign.swap(original);
}
-template<class T, class A>
-class set_propagate_test_wrapper
- : public boost::container::set<T, std::less<T>, A
- //tree_assoc_defaults
- >
-{
- BOOST_COPYABLE_AND_MOVABLE(set_propagate_test_wrapper)
- typedef boost::container::set<T, std::less<T>, A > Base;
- public:
- set_propagate_test_wrapper()
- : Base()
- {}
+struct boost_container_set;
+struct boost_container_multiset;
- set_propagate_test_wrapper(const set_propagate_test_wrapper &x)
- : Base(x)
- {}
-
- set_propagate_test_wrapper(BOOST_RV_REF(set_propagate_test_wrapper) x)
- : Base(boost::move(static_cast<Base&>(x)))
- {}
-
- set_propagate_test_wrapper &operator=(BOOST_COPY_ASSIGN_REF(set_propagate_test_wrapper) x)
- { this->Base::operator=(x); return *this; }
+namespace boost {
+namespace container {
+namespace test {
- set_propagate_test_wrapper &operator=(BOOST_RV_REF(set_propagate_test_wrapper) x)
- { this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
+template<>
+struct alloc_propagate_base<boost_container_set>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::set<T, std::less<T>, Allocator> type;
+ };
+};
- void swap(set_propagate_test_wrapper &x)
- { this->Base::swap(x); }
+template<>
+struct alloc_propagate_base<boost_container_multiset>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::multiset<T, std::less<T>, Allocator> type;
+ };
};
+}}} //boost::container::test
+
template<class VoidAllocator, boost::container::tree_type_enum tree_type_value>
struct GetAllocatorSet
{
@@ -324,36 +322,7 @@ int test_set_variants()
return 0;
}
-template<typename SetType>
-bool test_support_for_initialization_list_for()
-{
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- std::initializer_list<int> il = {1, 2, 3, 4, 5};
- SetType expected(il.begin(), il.end());
- {
- SetType sil = il;
- if (sil != expected)
- return false;
-
- SetType sil_ordered(ordered_unique_range, il);
- if(sil_ordered != expected)
- return false;
-
- SetType sil_assign = {99, 100, 101, 102, 103, 104, 105};
- sil_assign = il;
- if(sil_assign != expected)
- return false;
- }
- {
- SetType sil;
- sil.insert(il);
- if(sil != expected)
- return false;
- }
- return true;
-#endif
- return true;
-}
+
int main ()
{
//Recursive container instantiation
@@ -363,8 +332,8 @@ int main ()
}
//Allocator argument container
{
- set<int> set_((std::allocator<int>()));
- multiset<int> multiset_((std::allocator<int>()));
+ set<int> set_((set<int>::allocator_type()));
+ multiset<int> multiset_((multiset<int>::allocator_type()));
}
//Now test move semantics
{
@@ -427,13 +396,16 @@ int main ()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<set_propagate_test_wrapper>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_set>())
+ return 1;
+
+ if(!boost::container::test::test_propagate_allocator<boost_container_multiset>())
return 1;
- if(!test_support_for_initialization_list_for<set<int> >())
+ if (!boost::container::test::test_set_methods_with_initializer_list_as_argument_for<set<int> >())
return 1;
- if(!test_support_for_initialization_list_for<multiset<int> >())
+ if (!boost::container::test::test_set_methods_with_initializer_list_as_argument_for<multiset<int> >())
return 1;
////////////////////////////////////
diff --git a/libs/container/test/set_test.hpp b/libs/container/test/set_test.hpp
index 90db09323..1ab8af54c 100644
--- a/libs/container/test/set_test.hpp
+++ b/libs/container/test/set_test.hpp
@@ -13,22 +13,17 @@
#include <boost/container/detail/config_begin.hpp>
#include "check_equal_containers.hpp"
-#include <memory>
-#include <set>
-#include <functional>
#include "print_container.hpp"
#include <boost/move/utility_core.hpp>
#include <boost/move/iterator.hpp>
#include <boost/move/make_unique.hpp>
-#include <string>
-#include <boost/intrusive/detail/has_member_function_callable_with.hpp>
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME rebalance
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace boost { namespace container { namespace test {
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG namespace boost { namespace container { namespace test {
#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <boost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MIN 0
+#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 0
+#include <boost/intrusive/detail/has_member_function_callable_with.hpp>
namespace boost{
namespace container {
@@ -108,6 +103,20 @@ int set_test_copyable(boost::container::container_detail::true_type)
if(!CheckEqualContainers(boostmsetcopy, stdmsetcopy))
return 1;
}
+ {
+ //Now, test copy constructor
+ MyBoostSet boostsetcopy(boostset, typename MyBoostSet::allocator_type());
+ MyStdSet stdsetcopy(stdset);
+
+ if(!CheckEqualContainers(boostsetcopy, stdsetcopy))
+ return 1;
+
+ MyBoostMultiSet boostmsetcopy(boostmultiset, typename MyBoostSet::allocator_type());
+ MyStdMultiSet stdmsetcopy(stdmultiset);
+
+ if(!CheckEqualContainers(boostmsetcopy, stdmsetcopy))
+ return 1;
+ }
return 0;
}
@@ -132,6 +141,54 @@ int set_test ()
MyStdMultiSet &stdmultiset = *pstdmultiset;
//Test construction from a range
+ { //Set(beg, end, compare)
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i/2);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = i/2;
+ }
+ IntType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i/2);
+ aux_vect3[i] = boost::move(move_me);
+ }
+ ::boost::movelib::unique_ptr<MyBoostSet> const pboostset = ::boost::movelib::make_unique<MyBoostSet>
+ (boost::make_move_iterator(&aux_vect[0]), boost::make_move_iterator(&aux_vect[0]+50), typename MyBoostSet::key_compare());
+ ::boost::movelib::unique_ptr<MyStdSet> const pstdset = ::boost::movelib::make_unique<MyStdSet>(&aux_vect2[0], &aux_vect2[0]+50);
+ if(!test::CheckEqualContainers(*pboostset, *pstdset)) return 1;
+ ::boost::movelib::unique_ptr<MyBoostMultiSet> const pboostmultiset = ::boost::movelib::make_unique<MyBoostMultiSet>
+ (boost::make_move_iterator(&aux_vect3[0]), boost::make_move_iterator(&aux_vect3[0]+50), typename MyBoostMultiSet::key_compare());
+ ::boost::movelib::unique_ptr<MyStdMultiSet> const pstdmultiset = ::boost::movelib::make_unique<MyStdMultiSet>(&aux_vect2[0], &aux_vect2[0]+50);
+ if(!test::CheckEqualContainers(*pboostmultiset, *pstdmultiset)) return 1;
+ }
+ { //Set(beg, end, alloc)
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i/2);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = i/2;
+ }
+ IntType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i/2);
+ aux_vect3[i] = boost::move(move_me);
+ }
+ ::boost::movelib::unique_ptr<MyBoostSet> const pboostset = ::boost::movelib::make_unique<MyBoostSet>
+ (boost::make_move_iterator(&aux_vect[0]), boost::make_move_iterator(&aux_vect[0]+50), typename MyBoostSet::allocator_type());
+ ::boost::movelib::unique_ptr<MyStdSet> const pstdset = ::boost::movelib::make_unique<MyStdSet>(&aux_vect2[0], &aux_vect2[0]+50);
+ if(!test::CheckEqualContainers(*pboostset, *pstdset)) return 1;
+ ::boost::movelib::unique_ptr<MyBoostMultiSet> const pboostmultiset = ::boost::movelib::make_unique<MyBoostMultiSet>
+ (boost::make_move_iterator(&aux_vect3[0]), boost::make_move_iterator(&aux_vect3[0]+50), typename MyBoostMultiSet::allocator_type());
+ ::boost::movelib::unique_ptr<MyStdMultiSet> const pstdmultiset = ::boost::movelib::make_unique<MyStdMultiSet>(&aux_vect2[0], &aux_vect2[0]+50);
+ if(!test::CheckEqualContainers(*pboostmultiset, *pstdmultiset)) return 1;
+ }
{
IntType aux_vect[50];
for(int i = 0; i < 50; ++i){
@@ -188,7 +245,19 @@ int set_test ()
aux_vect3[i] = boost::move(move_me);
}
-
+ //some comparison operators
+ if(!(boostset2 == boostset2))
+ return 1;
+ if(boostset2 != boostset2)
+ return 1;
+ if(boostset2 < boostset2)
+ return 1;
+ if(boostset2 > boostset2)
+ return 1;
+ if(!(boostset2 <= boostset2))
+ return 1;
+ if(!(boostset2 >= boostset2))
+ return 1;
::boost::movelib::unique_ptr<MyBoostSet> const pboostset3 = ::boost::movelib::make_unique<MyBoostSet>
( ordered_unique_range
@@ -636,6 +705,47 @@ int set_test ()
return 0;
}
+template<typename SetType>
+bool test_set_methods_with_initializer_list_as_argument_for()
+{
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+ std::initializer_list<int> il = { 1, 2, 3, 4, 5, 5 };
+ std::initializer_list<int> ilu = { 1, 2, 3, 4, 5 };
+ SetType expected(il.begin(), il.end());
+ SetType expectedu(ilu.begin(), ilu.end());
+ {
+ SetType sil((il));
+ if (sil != expected)
+ return false;
+
+ SetType sila(il, typename SetType::allocator_type());
+ if (sila != expected)
+ return false;
+
+ SetType silca(il, typename SetType::key_compare(), typename SetType::allocator_type());
+ if (silca != expected)
+ return false;
+
+ SetType sil_ordered(ordered_unique_range, ilu);
+ if (sil_ordered != expectedu)
+ return false;
+
+ SetType sil_assign = { 99, 100, 101, 102, 103, 104, 105 };
+ sil_assign = il;
+ if (sil_assign != expected)
+ return false;
+ }
+ {
+ SetType sil;
+ sil.insert(il);
+ if (sil != expected)
+ return false;
+ }
+ return true;
+#endif
+ return true;
+}
+
} //namespace test{
} //namespace container {
} //namespace boost{
diff --git a/libs/container/test/slist_test.cpp b/libs/container/test/slist_test.cpp
index 6e7cda6e0..f73056ba2 100644
--- a/libs/container/test/slist_test.cpp
+++ b/libs/container/test/slist_test.cpp
@@ -59,7 +59,7 @@ public:
slist<recursive_slist> slist_;
slist<recursive_slist>::iterator it_;
slist<recursive_slist>::const_iterator cit_;
-
+
recursive_slist &operator=(const recursive_slist &o)
{ slist_ = o.slist_; return *this; }
};
@@ -121,7 +121,12 @@ bool test_support_for_initializer_list()
if(sl != expected_list)
return false;
}
-
+ {
+ slist<int> sl({ 1, 2 }, slist<int>::allocator_type());
+ sl = il;
+ if (sl != expected_list)
+ return false;
+ }
{
slist<int> sl = {4, 5};
sl.assign(il);
@@ -147,6 +152,24 @@ bool test_support_for_initializer_list()
return true;
}
+struct boost_container_slist;
+
+namespace boost {
+namespace container {
+namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_slist>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::slist<T, Allocator> type;
+ };
+};
+
+}}}
+
int main ()
{
recursive_slist_test();
@@ -202,7 +225,7 @@ int main ()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<slist>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_slist>())
return 1;
if(!test_support_for_initializer_list())
diff --git a/libs/container/test/small_vector_test.cpp b/libs/container/test/small_vector_test.cpp
new file mode 100644
index 000000000..10a939eec
--- /dev/null
+++ b/libs/container/test/small_vector_test.cpp
@@ -0,0 +1,183 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2013. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/container/small_vector.hpp>
+#include "vector_test.hpp"
+#include "movable_int.hpp"
+#include "propagate_allocator_test.hpp"
+#include "default_init_test.hpp"
+
+#include <boost/container/allocator.hpp>
+#include <boost/container/node_allocator.hpp>
+#include <boost/container/adaptive_pool.hpp>
+
+#include <iostream>
+
+namespace boost {
+namespace container {
+
+template class small_vector<char, 0>;
+template class small_vector<char, 1>;
+template class small_vector<char, 2>;
+template class small_vector<char, 10>;
+
+template class small_vector<int, 0>;
+template class small_vector<int, 1>;
+template class small_vector<int, 2>;
+template class small_vector<int, 10>;
+
+//Explicit instantiation to detect compilation errors
+template class boost::container::small_vector
+ < test::movable_and_copyable_int
+ , 10
+ , test::simple_allocator<test::movable_and_copyable_int> >;
+
+template class boost::container::small_vector
+ < test::movable_and_copyable_int
+ , 10
+ , test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+template class boost::container::small_vector
+ < test::movable_and_copyable_int
+ , 10
+ , std::allocator<test::movable_and_copyable_int> >;
+
+template class boost::container::small_vector
+ < test::movable_and_copyable_int
+ , 10
+ , allocator<test::movable_and_copyable_int> >;
+
+template class boost::container::small_vector
+ < test::movable_and_copyable_int
+ , 10
+ , adaptive_pool<test::movable_and_copyable_int> >;
+
+template class boost::container::small_vector
+ < test::movable_and_copyable_int
+ , 10
+ , node_allocator<test::movable_and_copyable_int> >;
+
+}}
+
+struct boost_container_small_vector;
+
+namespace boost { namespace container { namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_small_vector>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::small_vector<T, 10, Allocator> type;
+ };
+};
+
+}}} //namespace boost::container::test
+
+bool test_small_vector_base_test()
+{
+ typedef boost::container::small_vector_base<int> smb_t;
+ {
+ typedef boost::container::small_vector<int, 5> sm5_t;
+ sm5_t sm5;
+ smb_t &smb = sm5;
+ smb.push_back(1);
+ sm5_t sm5_copy(sm5);
+ sm5_copy.push_back(1);
+ if (!boost::container::test::CheckEqualContainers(sm5, smb))
+ return false;
+ }
+ {
+ typedef boost::container::small_vector<int, 5> sm7_t;
+ sm7_t sm7;
+ smb_t &smb = sm7;
+ smb.push_back(2);
+ sm7_t sm7_copy(sm7);
+ sm7_copy.push_back(2);
+ if (!boost::container::test::CheckEqualContainers(sm7, smb))
+ return false;
+ }
+ return true;
+}
+
+int main()
+{
+ using namespace boost::container;
+/*
+ typedef small_vector<char, 0>::storage_test storage_test;
+ std::cout << "needed_extra_storages: " << storage_test::needed_extra_storages << '\n';
+ std::cout << "needed_bytes: " << storage_test::needed_bytes << '\n';
+ std::cout << "header_bytes: " << storage_test::header_bytes << '\n';
+ std::cout << "s_start: " << storage_test::s_start << '\n';
+
+ //char
+ std::cout << "sizeof(small_vector<char, 0>): " << sizeof(small_vector<char, 0>) << " extra: " << small_vector<char, 0>::needed_extra_storages << " internal storage: " << small_vector<char, 0>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<char, 1>): " << sizeof(small_vector<char, 1>) << " extra: " << small_vector<char, 1>::needed_extra_storages << " internal storage: " << small_vector<char, 1>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<char, 2>): " << sizeof(small_vector<char, 2>) << " extra: " << small_vector<char, 2>::needed_extra_storages << " internal storage: " << small_vector<char, 2>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<char, 3>): " << sizeof(small_vector<char, 3>) << " extra: " << small_vector<char, 3>::needed_extra_storages << " internal storage: " << small_vector<char, 3>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<char, 4>): " << sizeof(small_vector<char, 4>) << " extra: " << small_vector<char, 4>::needed_extra_storages << " internal storage: " << small_vector<char, 4>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<char, 5>): " << sizeof(small_vector<char, 5>) << " extra: " << small_vector<char, 5>::needed_extra_storages << " internal storage: " << small_vector<char, 5>::internal_capacity() << '\n';
+ std::cout << "\n";
+
+ //short
+ std::cout << "sizeof(small_vector<short, 0>): " << sizeof(small_vector<short, 0>) << " extra: " << small_vector<short, 0>::needed_extra_storages << " internal storage: " << small_vector<short, 0>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<short, 1>): " << sizeof(small_vector<short, 1>) << " extra: " << small_vector<short, 1>::needed_extra_storages << " internal storage: " << small_vector<short, 1>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<short, 2>): " << sizeof(small_vector<short, 2>) << " extra: " << small_vector<short, 2>::needed_extra_storages << " internal storage: " << small_vector<short, 2>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<short, 3>): " << sizeof(small_vector<short, 3>) << " extra: " << small_vector<short, 3>::needed_extra_storages << " internal storage: " << small_vector<short, 3>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<short, 4>): " << sizeof(small_vector<short, 4>) << " extra: " << small_vector<short, 4>::needed_extra_storages << " internal storage: " << small_vector<short, 4>::internal_capacity() << '\n';
+ std::cout << "sizeof(small_vector<short, 5>): " << sizeof(small_vector<short, 5>) << " extra: " << small_vector<short, 5>::needed_extra_storages << " internal storage: " << small_vector<short, 5>::internal_capacity() << '\n';
+*/
+ if(test::vector_test< small_vector<int, 0> >())
+ return 1;
+
+ if(test::vector_test< small_vector<int, 2000> >())
+ return 1;
+
+
+ ////////////////////////////////////
+ // Default init test
+ ////////////////////////////////////
+ if(!test::default_init_test< vector<int, test::default_init_allocator<int> > >()){
+ std::cerr << "Default init test failed" << std::endl;
+ return 1;
+ }
+
+ ////////////////////////////////////
+ // Emplace testing
+ ////////////////////////////////////
+ const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_BEFORE);
+ if(!boost::container::test::test_emplace< vector<test::EmplaceInt>, Options>()){
+ return 1;
+ }
+
+ ////////////////////////////////////
+ // Allocator propagation testing
+ ////////////////////////////////////
+ if(!boost::container::test::test_propagate_allocator<boost_container_small_vector>()){
+ return 1;
+ }
+
+ ////////////////////////////////////
+ // Initializer lists testing
+ ////////////////////////////////////
+ if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for
+ < boost::container::small_vector<int, 5> >()) {
+ return 1;
+ }
+
+ ////////////////////////////////////
+ // Small vector base
+ ////////////////////////////////////
+ if (!test_small_vector_base_test()){
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/libs/container/test/stable_vector_test.cpp b/libs/container/test/stable_vector_test.cpp
index eeb3c7faf..3ff73e3e4 100644
--- a/libs/container/test/stable_vector_test.cpp
+++ b/libs/container/test/stable_vector_test.cpp
@@ -9,11 +9,7 @@
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
-#include <algorithm>
#include <memory>
-#include <vector>
-#include <iostream>
-#include <functional>
#include <boost/container/stable_vector.hpp>
#include <boost/container/allocator.hpp>
@@ -70,7 +66,7 @@ class recursive_vector
stable_vector<recursive_vector>::const_iterator cit_;
stable_vector<recursive_vector>::reverse_iterator rit_;
stable_vector<recursive_vector>::const_reverse_iterator crit_;
-
+
recursive_vector &operator=(const recursive_vector &o)
{ vector_ = o.vector_; return *this; }
};
@@ -117,6 +113,23 @@ int test_cont_variants()
return 0;
}
+struct boost_container_stable_vector;
+
+namespace boost { namespace container { namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_stable_vector>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::stable_vector<T, Allocator> type;
+ };
+};
+
+}}} //namespace boost::container::test
+
+
int main()
{
recursive_vector_test();
@@ -180,15 +193,14 @@ int main()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<stable_vector>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_stable_vector>())
return 1;
////////////////////////////////////
// Initializer lists testing
////////////////////////////////////
- if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for<
- boost::container::stable_vector<int>
- >())
+ if(!boost::container::test::test_vector_methods_with_initializer_list_as_argument_for
+ < boost::container::stable_vector<int> >())
{
std::cerr << "test_methods_with_initializer_list_as_argument failed" << std::endl;
return 1;
diff --git a/libs/container/test/static_vector_test.cpp b/libs/container/test/static_vector_test.cpp
index 69b5dd1bd..eb48f62e9 100644
--- a/libs/container/test/static_vector_test.cpp
+++ b/libs/container/test/static_vector_test.cpp
@@ -10,13 +10,13 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/no_exceptions_support.hpp>
+#include <boost/container/vector.hpp>
+#include <boost/container/stable_vector.hpp>
+#include <boost/container/detail/iterator.hpp>
#include <vector>
#include <list>
-#include <boost/container/vector.hpp>
-#include <boost/container/stable_vector.hpp>
-
#include "static_vector_test.hpp"
namespace boost {
@@ -208,7 +208,7 @@ void test_pop_back_nd()
template <typename It1, typename It2>
void test_compare_ranges(It1 first1, It1 last1, It2 first2, It2 last2)
{
- BOOST_TEST(std::distance(first1, last1) == std::distance(first2, last2));
+ BOOST_TEST(boost::container::iterator_distance(first1, last1) == boost::container::iterator_distance(first2, last2));
for ( ; first1 != last1 && first2 != last2 ; ++first1, ++first2 )
BOOST_TEST(*first1 == *first2);
}
@@ -352,7 +352,7 @@ void test_insert(SV const& s, C const& c)
static_vector<T, N> s1(s);
typename C::const_iterator it = c.begin();
- std::advance(it, n);
+ boost::container::iterator_advance(it, n);
typename static_vector<T, N>::iterator
it1 = s1.insert(s1.begin() + i, c.begin(), it);
diff --git a/libs/container/test/static_vector_test.hpp b/libs/container/test/static_vector_test.hpp
index 1686955c7..ab931b274 100644
--- a/libs/container/test/static_vector_test.hpp
+++ b/libs/container/test/static_vector_test.hpp
@@ -78,6 +78,9 @@ private:
namespace boost {
+template <class T>
+struct has_nothrow_move;
+
template <>
struct has_nothrow_move<counting_value>
{
diff --git a/libs/container/test/string_test.cpp b/libs/container/test/string_test.cpp
index caa7eac76..2e3f6703d 100644
--- a/libs/container/test/string_test.cpp
+++ b/libs/container/test/string_test.cpp
@@ -13,7 +13,7 @@
#include <boost/container/string.hpp>
#include <string>
#include <vector>
-#include <algorithm>
+#include <boost/container/detail/algorithm.hpp> //equal()
#include <cstring>
#include <cstdio>
#include <cstddef>
@@ -68,7 +68,7 @@ template<class StrVector1, class StrVector2>
bool CheckEqualStringVector(StrVector1 *strvect1, StrVector2 *strvect2)
{
StringEqual comp;
- return std::equal(strvect1->begin(), strvect1->end(),
+ return boost::container::algo_equal(strvect1->begin(), strvect1->end(),
strvect2->begin(), comp);
}
@@ -432,35 +432,22 @@ bool test_expand_bwd()
return test::test_all_expand_bwd<string_type>();
}
-template<class T, class A>
-class string_propagate_test_wrapper
- : public basic_string<T, std::char_traits<T>, A>
-{
- BOOST_COPYABLE_AND_MOVABLE(string_propagate_test_wrapper)
- typedef basic_string<T, std::char_traits<T>, A> Base;
- public:
- string_propagate_test_wrapper()
- : Base()
- {}
-
- string_propagate_test_wrapper(const string_propagate_test_wrapper &x)
- : Base(x)
- {}
-
- string_propagate_test_wrapper(BOOST_RV_REF(string_propagate_test_wrapper) x)
- : Base(boost::move(static_cast<Base&>(x)))
- {}
-
- string_propagate_test_wrapper &operator=(BOOST_COPY_ASSIGN_REF(string_propagate_test_wrapper) x)
- { this->Base::operator=(x); return *this; }
+struct boost_container_string;
- string_propagate_test_wrapper &operator=(BOOST_RV_REF(string_propagate_test_wrapper) x)
- { this->Base::operator=(boost::move(static_cast<Base&>(x))); return *this; }
+namespace boost { namespace container { namespace test {
- void swap(string_propagate_test_wrapper &x)
- { this->Base::swap(x); }
+template<>
+struct alloc_propagate_base<boost_container_string>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::basic_string<T, std::char_traits<T>, Allocator> type;
+ };
};
+}}} //namespace boost::container::test
+
int main()
{
if(string_test<char>()){
@@ -480,7 +467,7 @@ int main()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<string_propagate_test_wrapper>())
+ if(!boost::container::test::test_propagate_allocator<boost_container_string>())
return 1;
////////////////////////////////////
diff --git a/libs/container/test/vector_test.cpp b/libs/container/test/vector_test.cpp
index 0ec3eb157..b84026237 100644
--- a/libs/container/test/vector_test.cpp
+++ b/libs/container/test/vector_test.cpp
@@ -7,10 +7,8 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
-
#include <memory>
#include <iostream>
-#include <functional>
#include <boost/container/vector.hpp>
#include <boost/container/allocator.hpp>
@@ -147,6 +145,22 @@ int test_cont_variants()
return 0;
}
+struct boost_container_vector;
+
+namespace boost { namespace container { namespace test {
+
+template<>
+struct alloc_propagate_base<boost_container_vector>
+{
+ template <class T, class Allocator>
+ struct apply
+ {
+ typedef boost::container::vector<T, Allocator> type;
+ };
+};
+
+}}} //namespace boost::container::test
+
int main()
{
{
@@ -237,7 +251,7 @@ int main()
////////////////////////////////////
// Allocator propagation testing
////////////////////////////////////
- if(!boost::container::test::test_propagate_allocator<vector>()){
+ if(!boost::container::test::test_propagate_allocator<boost_container_vector>()){
return 1;
}
diff --git a/libs/container/test/vector_test.hpp b/libs/container/test/vector_test.hpp
index 7112849c2..6662d844f 100644
--- a/libs/container/test/vector_test.hpp
+++ b/libs/container/test/vector_test.hpp
@@ -12,28 +12,31 @@
#define BOOST_CONTAINER_TEST_VECTOR_TEST_HEADER
#include <boost/container/detail/config_begin.hpp>
-#include <algorithm>
-#include <memory>
+
#include <vector>
#include <iostream>
-#include <functional>
#include <list>
#include <boost/move/utility_core.hpp>
#include <boost/container/detail/mpl.hpp>
-#include "print_container.hpp"
-#include "check_equal_containers.hpp"
-#include "movable_int.hpp"
-#include <string>
-#include <vector>
-#include "emplace_test.hpp"
-#include "input_from_forward_iterator.hpp"
#include <boost/move/utility_core.hpp>
#include <boost/move/iterator.hpp>
#include <boost/move/make_unique.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/static_assert.hpp>
+
+#include "print_container.hpp"
+#include "check_equal_containers.hpp"
+#include "movable_int.hpp"
+#include "emplace_test.hpp"
+#include "input_from_forward_iterator.hpp"
#include "insert_test.hpp"
+#include "container_common_tests.hpp"
+
+#include <cstddef>
+#include <string>
+#include <vector>
+
namespace boost{
namespace container {
@@ -83,7 +86,7 @@ bool vector_copyable_only(V1 &boostvector, V2 &stdvector, boost::container::cont
stdvector.push_back(int(3));
if(!test::CheckEqualContainers(boostvector, stdvector)) return false;
}
- {
+ { //Vector(const Vector &)
::boost::movelib::unique_ptr<V1> const pv1 = ::boost::movelib::make_unique<V1>(boostvector);
::boost::movelib::unique_ptr<V2> const pv2 = ::boost::movelib::make_unique<V2>(stdvector);
@@ -96,6 +99,19 @@ bool vector_copyable_only(V1 &boostvector, V2 &stdvector, boost::container::cont
stdvector.assign(v2.begin(), v2.end());
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
}
+ { //Vector(const Vector &, alloc)
+ ::boost::movelib::unique_ptr<V1> const pv1 = ::boost::movelib::make_unique<V1>(boostvector, typename V1::allocator_type());
+ ::boost::movelib::unique_ptr<V2> const pv2 = ::boost::movelib::make_unique<V2>(stdvector);
+
+ V1 &v1 = *pv1;
+ V2 &v2 = *pv2;
+
+ boostvector.clear();
+ stdvector.clear();
+ boostvector.assign(v1.begin(), v1.end());
+ stdvector.assign(v2.begin(), v2.end());
+ if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
+ }
return true;
}
@@ -110,7 +126,36 @@ int vector_test()
if(!test_range_insertion<MyBoostVector>()){
return 1;
}
-
+ { //Vector(n)
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>(100);
+ ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>(100);
+ if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
+ }
+ { //Vector(n, alloc)
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>(100, typename MyBoostVector::allocator_type());
+ ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>(100);
+ if(!test::CheckEqualContainers(*boostvectorp, *stdvectorp)) return 1;
+ }
+ { //Vector(Vector &&)
+ ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>(100);
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>(100);
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 = ::boost::movelib::make_unique<MyBoostVector>(::boost::move(*boostvectorp));
+ if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
+ }
+ { //Vector(Vector &&, alloc)
+ ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>(100);
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>(100);
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 = ::boost::movelib::make_unique<MyBoostVector>
+ (::boost::move(*boostvectorp), typename MyBoostVector::allocator_type());
+ if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
+ }
+ { //Vector operator=(Vector &&)
+ ::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>(100);
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>(100);
+ ::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp2 = ::boost::movelib::make_unique<MyBoostVector>();
+ *boostvectorp2 = ::boost::move(*boostvectorp);
+ if(!test::CheckEqualContainers(*boostvectorp2, *stdvectorp)) return 1;
+ }
{
::boost::movelib::unique_ptr<MyBoostVector> const boostvectorp = ::boost::movelib::make_unique<MyBoostVector>();
::boost::movelib::unique_ptr<MyStdVector> const stdvectorp = ::boost::movelib::make_unique<MyStdVector>();
@@ -167,7 +212,7 @@ int vector_test()
boostvector.insert(boostvector.end()
,boost::make_move_iterator(&aux_vect[0])
,boost::make_move_iterator(aux_vect + 50));
- if(std::size_t(std::distance(insert_it, boostvector.end())) != 50) return 1;
+ if(std::size_t(boost::container::iterator_distance(insert_it, boostvector.end())) != 50) return 1;
stdvector.insert(stdvector.end(), aux_vect2, aux_vect2 + 50);
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
@@ -276,6 +321,20 @@ int vector_test()
}
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
+ //some comparison operators
+ if(!(boostvector == boostvector))
+ return 1;
+ if(boostvector != boostvector)
+ return 1;
+ if(boostvector < boostvector)
+ return 1;
+ if(boostvector > boostvector)
+ return 1;
+ if(!(boostvector <= boostvector))
+ return 1;
+ if(!(boostvector >= boostvector))
+ return 1;
+
//Test insertion from list
{
std::list<int> l(50, int(1));
@@ -294,6 +353,10 @@ int vector_test()
stdvector.assign(l.begin(), l.end());
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
}
+
+ boostvector.resize(100);
+ if(!test_nth_index_of(boostvector))
+ return 1;
/* deque has no reserve or capacity
std::size_t cap = boostvector.capacity();
boostvector.reserve(cap*2);
@@ -326,12 +389,17 @@ template<typename VectorContainerType>
bool test_vector_methods_with_initializer_list_as_argument_for()
{
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+ typedef typename VectorContainerType::allocator_type allocator_type;
{
const VectorContainerType testedVector = {1, 2, 3};
const std::vector<int> expectedVector = {1, 2, 3};
if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
}
-
+ {
+ const VectorContainerType testedVector( { 1, 2, 3 }, allocator_type() );
+ const std::vector<int> expectedVector = {1, 2, 3};
+ if(!test::CheckEqualContainers(testedVector, expectedVector)) return false;
+ }
{
VectorContainerType testedVector = {1, 2, 3};
testedVector = {11, 12, 13};