Reduce redundant instantiations to improve test build times

This commit is contained in:
Ion Gaztañaga
2016-02-23 13:29:46 +01:00
parent e6182f025c
commit 33b331da38
12 changed files with 10 additions and 630 deletions

View File

@@ -16,8 +16,6 @@
#include <boost/container/deque.hpp> #include <boost/container/deque.hpp>
#include <boost/container/allocator.hpp> #include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include "print_container.hpp" #include "print_container.hpp"
#include "check_equal_containers.hpp" #include "check_equal_containers.hpp"
@@ -45,26 +43,10 @@ template class boost::container::deque
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::simple_allocator<test::movable_and_copyable_int> >; , test::simple_allocator<test::movable_and_copyable_int> >;
template class boost::container::deque
< test::movable_and_copyable_int
, test::dummy_test_allocator<test::movable_and_copyable_int> >;
template class boost::container::deque
< test::movable_and_copyable_int
, std::allocator<test::movable_and_copyable_int> >;
template class boost::container::deque template class boost::container::deque
< test::movable_and_copyable_int < test::movable_and_copyable_int
, allocator<test::movable_and_copyable_int> >; , allocator<test::movable_and_copyable_int> >;
template class boost::container::deque
< test::movable_and_copyable_int
, adaptive_pool<test::movable_and_copyable_int> >;
template class boost::container::deque
< test::movable_and_copyable_int
, node_allocator<test::movable_and_copyable_int> >;
}} }}
//Function to check if both sets are equal //Function to check if both sets are equal
@@ -388,16 +370,6 @@ int main ()
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::node_allocator
if(test_cont_variants< node_allocator<void> >()){
std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool
if(test_cont_variants< adaptive_pool<void> >()){
std::cerr << "test_cont_variants< adaptive_pool<void> > failed" << std::endl;
return 1;
}
//////////////////////////////////// ////////////////////////////////////
// Default init test // Default init test
//////////////////////////////////// ////////////////////////////////////

View File

@@ -73,138 +73,6 @@ class simple_allocator
{ return false; } { return false; }
}; };
//Version 2 allocator with rebind
template<class T>
class dummy_test_allocator
{
private:
typedef dummy_test_allocator<T> self_t;
typedef void * aux_pointer_t;
typedef const void * cvoid_ptr;
public:
typedef T value_type;
typedef T * pointer;
typedef const T * const_pointer;
typedef typename container_detail::
unvoid_ref<value_type>::type reference;
typedef typename container_detail::
unvoid_ref<const value_type>::type const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef container_detail::basic_multiallocation_chain
<void*> multialloc_cached_counted;
typedef boost::container::container_detail::transform_multiallocation_chain
<multialloc_cached_counted, value_type> multiallocation_chain;
typedef boost::container::container_detail::version_type<dummy_test_allocator, 2> version;
template<class T2>
struct rebind
{ typedef dummy_test_allocator<T2> other; };
//!Default constructor. Never throws
dummy_test_allocator()
{}
//!Constructor from other dummy_test_allocator. Never throws
dummy_test_allocator(const dummy_test_allocator &)
{}
//!Constructor from related dummy_test_allocator. Never throws
template<class T2>
dummy_test_allocator(const dummy_test_allocator<T2> &)
{}
pointer address(reference value)
{ return pointer(container_detail::addressof(value)); }
const_pointer address(const_reference value) const
{ return const_pointer(container_detail::addressof(value)); }
pointer allocate(size_type, cvoid_ptr = 0)
{ return 0; }
void deallocate(const pointer &, size_type)
{ }
template<class Convertible>
void construct(pointer, const Convertible &)
{}
void destroy(pointer)
{}
size_type max_size() const
{ return 0; }
friend void swap(self_t &, self_t &)
{}
//Experimental version 2 dummy_test_allocator functions
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.
size_type size(const pointer &) const
{ return 0; }
//!Allocates just one object. Memory allocated with this function
//!must be deallocated only with deallocate_one().
//!Throws boost::container::bad_alloc if there is no enough memory
pointer allocate_one()
{ return pointer(); }
//!Deallocates memory previously allocated with allocate_one().
//!You should never use deallocate_one to deallocate memory allocated
//!with other functions different from allocate_one(). Never throws
void deallocate_one(const pointer &)
{}
//!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
//!will be assigned to received_size. Memory allocated with this function
//!must be deallocated only with deallocate_one().
void allocate_individual(size_type, multiallocation_chain &)
{}
//!Allocates many elements of size == 1 in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
//!will be assigned to received_size. Memory allocated with this function
//!must be deallocated only with deallocate_one().
void deallocate_individual(multiallocation_chain &)
{}
//!Allocates many elements of size elem_size in a contiguous block
//!of memory. The minimum number to be allocated is min_elements,
//!the preferred and maximum number is
//!preferred_elements. The number of actually allocated elements is
//!will be assigned to received_size. The elements must be deallocated
//!with deallocate(...)
void deallocate_many(multiallocation_chain &)
{}
};
//!Equality test for same type of dummy_test_allocator
template<class T> inline
bool operator==(const dummy_test_allocator<T> &,
const dummy_test_allocator<T> &)
{ return true; }
//!Inequality test for same type of dummy_test_allocator
template<class T> inline
bool operator!=(const dummy_test_allocator<T> &,
const dummy_test_allocator<T> &)
{ return false; }
template< class T template< class T
, bool PropagateOnContCopyAssign , bool PropagateOnContCopyAssign
, bool PropagateOnContMoveAssign , bool PropagateOnContMoveAssign

View File

@@ -11,8 +11,6 @@
#include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/config_begin.hpp>
#include <boost/container/flat_map.hpp> #include <boost/container/flat_map.hpp>
#include <boost/container/allocator.hpp> #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 <boost/container/detail/flat_tree.hpp>
#include "print_container.hpp" #include "print_container.hpp"
@@ -36,13 +34,6 @@ namespace container {
//Explicit instantiation to detect compilation errors //Explicit instantiation to detect compilation errors
//flat_map //flat_map
template class flat_map
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class flat_map template class flat_map
< test::movable_and_copyable_int < test::movable_and_copyable_int
@@ -68,31 +59,7 @@ template class flat_map
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>; >;
template class flat_map
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, adaptive_pool
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class flat_map
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
//flat_multimap //flat_multimap
template class flat_multimap
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class flat_multimap template class flat_multimap
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -117,22 +84,6 @@ template class flat_multimap
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>; >;
template class flat_multimap
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, adaptive_pool
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class flat_multimap
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator
< std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
//As flat container iterators are typedefs for vector::[const_]iterator, //As flat container iterators are typedefs for vector::[const_]iterator,
//no need to explicit instantiate them //no need to explicit instantiate them
@@ -463,16 +414,6 @@ int main()
std::cerr << "test_map_variants< allocator<void> > failed" << std::endl; std::cerr << "test_map_variants< allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::node_allocator
if(test_map_variants< node_allocator<void> >()){
std::cerr << "test_map_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool
if(test_map_variants< adaptive_pool<void> >()){
std::cerr << "test_map_variants< adaptive_pool<void> > failed" << std::endl;
return 1;
}
if(!boost::container::test::test_map_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; return 1;

View File

@@ -12,8 +12,6 @@
#include <set> #include <set>
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
#include <boost/container/allocator.hpp> #include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include "print_container.hpp" #include "print_container.hpp"
#include "dummy_test_allocator.hpp" #include "dummy_test_allocator.hpp"
@@ -34,90 +32,34 @@ namespace container {
//Explicit instantiation to detect compilation errors //Explicit instantiation to detect compilation errors
//flat_set //flat_set
template class flat_set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator<test::movable_and_copyable_int>
>;
template class flat_set template class flat_set
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, test::simple_allocator<test::movable_and_copyable_int> , test::simple_allocator<test::movable_and_copyable_int>
>; >;
template class flat_set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, std::allocator<test::movable_and_copyable_int>
>;
template class flat_set template class flat_set
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, allocator<test::movable_and_copyable_int> , allocator<test::movable_and_copyable_int>
>; >;
template class flat_set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, adaptive_pool<test::movable_and_copyable_int>
>;
template class flat_set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator<test::movable_and_copyable_int>
>;
//flat_multiset //flat_multiset
template class flat_multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator<test::movable_and_copyable_int>
>;
template class flat_multiset template class flat_multiset
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, test::simple_allocator<test::movable_and_copyable_int> , test::simple_allocator<test::movable_and_copyable_int>
>; >;
template class flat_multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, std::allocator<test::movable_and_copyable_int>
>;
template class flat_multiset template class flat_multiset
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, allocator<test::movable_and_copyable_int> , allocator<test::movable_and_copyable_int>
>; >;
template class flat_multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, adaptive_pool<test::movable_and_copyable_int>
>;
template class flat_multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator<test::movable_and_copyable_int>
>;
namespace container_detail { namespace container_detail {
//Instantiate base class as previous instantiations don't instantiate inherited members //Instantiate base class as previous instantiations don't instantiate inherited members
template class flat_tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator<test::movable_and_copyable_int>
>;
template class flat_tree template class flat_tree
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -126,14 +68,6 @@ template class flat_tree
, test::simple_allocator<test::movable_and_copyable_int> , test::simple_allocator<test::movable_and_copyable_int>
>; >;
template class flat_tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, std::allocator<test::movable_and_copyable_int>
>;
template class flat_tree template class flat_tree
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -142,22 +76,6 @@ template class flat_tree
, allocator<test::movable_and_copyable_int> , allocator<test::movable_and_copyable_int>
>; >;
template class flat_tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, adaptive_pool<test::movable_and_copyable_int>
>;
template class flat_tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, node_allocator<test::movable_and_copyable_int>
>;
} //container_detail { } //container_detail {
//As flat container iterators are typedefs for vector::[const_]iterator, //As flat container iterators are typedefs for vector::[const_]iterator,
@@ -588,16 +506,6 @@ int main()
std::cerr << "test_set_variants< allocator<void> > failed" << std::endl; std::cerr << "test_set_variants< allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::node_allocator
if(test_set_variants< node_allocator<void> >()){
std::cerr << "test_set_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool
if(test_set_variants< adaptive_pool<void> >()){
std::cerr << "test_set_variants< adaptive_pool<void> > failed" << std::endl;
return 1;
}
//////////////////////////////////// ////////////////////////////////////
// Emplace testing // Emplace testing

View File

@@ -10,8 +10,6 @@
#include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/config_begin.hpp>
#include <boost/container/list.hpp> #include <boost/container/list.hpp>
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp> #include <boost/container/adaptive_pool.hpp>
#include "dummy_test_allocator.hpp" #include "dummy_test_allocator.hpp"
@@ -32,26 +30,10 @@ template class boost::container::list
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::simple_allocator<test::movable_and_copyable_int> >; , test::simple_allocator<test::movable_and_copyable_int> >;
template class boost::container::list
< test::movable_and_copyable_int
, test::dummy_test_allocator<test::movable_and_copyable_int> >;
template class boost::container::list
< test::movable_and_copyable_int
, std::allocator<test::movable_and_copyable_int> >;
template class boost::container::list
< test::movable_and_copyable_int
, allocator<test::movable_and_copyable_int> >;
template class boost::container::list template class boost::container::list
< test::movable_and_copyable_int < test::movable_and_copyable_int
, adaptive_pool<test::movable_and_copyable_int> >; , adaptive_pool<test::movable_and_copyable_int> >;
template class boost::container::list
< test::movable_and_copyable_int
, node_allocator<test::movable_and_copyable_int> >;
namespace container_detail { namespace container_detail {
template class iterator_from_iiterator template class iterator_from_iiterator
@@ -191,16 +173,6 @@ int main ()
std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::allocator
if(test_cont_variants< allocator<void> >()){
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::node_allocator
if(test_cont_variants< node_allocator<void> >()){
std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool // boost::container::adaptive_pool
if(test_cont_variants< adaptive_pool<void> >()){ if(test_cont_variants< adaptive_pool<void> >()){
std::cerr << "test_cont_variants< adaptive_pool<void> > failed" << std::endl; std::cerr << "test_cont_variants< adaptive_pool<void> > failed" << std::endl;

View File

@@ -9,8 +9,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/config_begin.hpp>
#include <boost/container/map.hpp> #include <boost/container/map.hpp>
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp> #include <boost/container/adaptive_pool.hpp>
#include <map> #include <map>
@@ -31,14 +29,6 @@ namespace container {
//Explicit instantiation to detect compilation errors //Explicit instantiation to detect compilation errors
//map //map
template class map
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class map template class map
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -55,15 +45,6 @@ template class map
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>; >;
template class map
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class map template class map
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -72,23 +53,7 @@ template class map
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>; >;
template class map
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
//multimap //multimap
template class multimap
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class multimap template class multimap
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -105,14 +70,6 @@ template class multimap
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>; >;
template class multimap
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
template class multimap template class multimap
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -121,25 +78,8 @@ template class multimap
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>; >;
template class multimap
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
>;
namespace container_detail { namespace container_detail {
template class tree
< const test::movable_and_copyable_int
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, tree_assoc_defaults >;
template class tree template class tree
< const test::movable_and_copyable_int < const test::movable_and_copyable_int
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> , std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
@@ -158,15 +98,6 @@ template class tree
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, tree_assoc_defaults >; , tree_assoc_defaults >;
template class tree
< const test::movable_and_copyable_int
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, std::less<test::movable_and_copyable_int>
, allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, tree_assoc_defaults >;
template class tree template class tree
< const test::movable_and_copyable_int < const test::movable_and_copyable_int
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> , std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
@@ -176,15 +107,6 @@ template class tree
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> > < std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, tree_assoc_defaults >; , tree_assoc_defaults >;
template class tree
< const test::movable_and_copyable_int
, std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int>
, container_detail::select1st< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, std::less<test::movable_and_copyable_int>
, node_allocator
< std::pair<const test::movable_and_copyable_int, test::movable_and_copyable_int> >
, tree_assoc_defaults >;
} //container_detail { } //container_detail {
}} //boost::container }} //boost::container
@@ -376,16 +298,6 @@ int main ()
std::cerr << "test_map_variants< std::allocator<void> > failed" << std::endl; std::cerr << "test_map_variants< std::allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::allocator
if(test_map_variants< allocator<void>, red_black_tree >()){
std::cerr << "test_map_variants< allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::node_allocator
if(test_map_variants< node_allocator<void>, red_black_tree >()){
std::cerr << "test_map_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool // boost::container::adaptive_pool
if(test_map_variants< adaptive_pool<void>, red_black_tree >()){ if(test_map_variants< adaptive_pool<void>, red_black_tree >()){
std::cerr << "test_map_variants< adaptive_pool<void> > failed" << std::endl; std::cerr << "test_map_variants< adaptive_pool<void> > failed" << std::endl;

View File

@@ -10,8 +10,6 @@
#include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/config_begin.hpp>
#include <set> #include <set>
#include <boost/container/set.hpp> #include <boost/container/set.hpp>
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp> #include <boost/container/adaptive_pool.hpp>
#include "print_container.hpp" #include "print_container.hpp"
@@ -30,91 +28,34 @@ namespace container {
//Explicit instantiation to detect compilation errors //Explicit instantiation to detect compilation errors
//set //set
template class set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator<test::movable_and_copyable_int>
>;
template class set template class set
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, test::simple_allocator<test::movable_and_copyable_int> , test::simple_allocator<test::movable_and_copyable_int>
>; >;
template class set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, std::allocator<test::movable_and_copyable_int>
>;
template class set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, allocator<test::movable_and_copyable_int>
>;
template class set template class set
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, adaptive_pool<test::movable_and_copyable_int> , adaptive_pool<test::movable_and_copyable_int>
>; >;
template class set
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator<test::movable_and_copyable_int>
>;
//multiset //multiset
template class multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator<test::movable_and_copyable_int>
>;
template class multiset template class multiset
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, test::simple_allocator<test::movable_and_copyable_int> , test::simple_allocator<test::movable_and_copyable_int>
>; >;
template class multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, std::allocator<test::movable_and_copyable_int>
>;
template class multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, allocator<test::movable_and_copyable_int>
>;
template class multiset template class multiset
< test::movable_and_copyable_int < test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int> , std::less<test::movable_and_copyable_int>
, adaptive_pool<test::movable_and_copyable_int> , adaptive_pool<test::movable_and_copyable_int>
>; >;
template class multiset
< test::movable_and_copyable_int
, std::less<test::movable_and_copyable_int>
, node_allocator<test::movable_and_copyable_int>
>;
namespace container_detail { namespace container_detail {
//Instantiate base class as previous instantiations don't instantiate inherited members //Instantiate base class as previous instantiations don't instantiate inherited members
template class tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, test::dummy_test_allocator<test::movable_and_copyable_int>
, tree_assoc_defaults
>;
template class tree template class tree
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -133,15 +74,6 @@ template class tree
, tree_assoc_defaults , tree_assoc_defaults
>; >;
template class tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, allocator<test::movable_and_copyable_int>
, tree_assoc_defaults
>;
template class tree template class tree
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::movable_and_copyable_int , test::movable_and_copyable_int
@@ -151,15 +83,6 @@ template class tree
, tree_assoc_defaults , tree_assoc_defaults
>; >;
template class tree
< test::movable_and_copyable_int
, test::movable_and_copyable_int
, identity<test::movable_and_copyable_int>
, std::less<test::movable_and_copyable_int>
, node_allocator<test::movable_and_copyable_int>
, tree_assoc_defaults
>;
} //container_detail { } //container_detail {
}} //boost::container }} //boost::container
@@ -350,16 +273,6 @@ int main ()
std::cerr << "test_set_variants< std::allocator<void> > failed" << std::endl; std::cerr << "test_set_variants< std::allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::allocator
if(test_set_variants< allocator<void>, red_black_tree>()){
std::cerr << "test_set_variants< allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::node_allocator
if(test_set_variants< node_allocator<void>, red_black_tree>()){
std::cerr << "test_set_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool // boost::container::adaptive_pool
if(test_set_variants< adaptive_pool<void>, red_black_tree>()){ if(test_set_variants< adaptive_pool<void>, red_black_tree>()){
std::cerr << "test_set_variants< adaptive_pool<void> > failed" << std::endl; std::cerr << "test_set_variants< adaptive_pool<void> > failed" << std::endl;

View File

@@ -9,9 +9,7 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/config_begin.hpp>
#include <boost/container/slist.hpp> #include <boost/container/slist.hpp>
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp> #include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include <memory> #include <memory>
#include "dummy_test_allocator.hpp" #include "dummy_test_allocator.hpp"
@@ -31,22 +29,6 @@ template class boost::container::slist
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::simple_allocator<test::movable_and_copyable_int> >; , test::simple_allocator<test::movable_and_copyable_int> >;
template class boost::container::slist
< test::movable_and_copyable_int
, test::dummy_test_allocator<test::movable_and_copyable_int> >;
template class boost::container::slist
< test::movable_and_copyable_int
, std::allocator<test::movable_and_copyable_int> >;
template class boost::container::slist
< test::movable_and_copyable_int
, allocator<test::movable_and_copyable_int> >;
template class boost::container::slist
< test::movable_and_copyable_int
, adaptive_pool<test::movable_and_copyable_int> >;
template class boost::container::slist template class boost::container::slist
< test::movable_and_copyable_int < test::movable_and_copyable_int
, node_allocator<test::movable_and_copyable_int> >; , node_allocator<test::movable_and_copyable_int> >;
@@ -197,21 +179,11 @@ int main ()
std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::allocator
if(test_cont_variants< allocator<void> >()){
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::node_allocator // boost::container::node_allocator
if(test_cont_variants< node_allocator<void> >()){ if(test_cont_variants< node_allocator<void> >()){
std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::adaptive_pool
if(test_cont_variants< adaptive_pool<void> >()){
std::cerr << "test_cont_variants< adaptive_pool<void> > failed" << std::endl;
return 1;
}
//////////////////////////////////// ////////////////////////////////////
// Emplace testing // Emplace testing

View File

@@ -15,8 +15,6 @@
#include "../../intrusive/test/iterator_test.hpp" #include "../../intrusive/test/iterator_test.hpp"
#include <boost/container/allocator.hpp> #include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include <iostream> #include <iostream>
@@ -39,31 +37,11 @@ template class boost::container::small_vector
, 10 , 10
, test::simple_allocator<test::movable_and_copyable_int> >; , 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 template class boost::container::small_vector
< test::movable_and_copyable_int < test::movable_and_copyable_int
, 10 , 10
, allocator<test::movable_and_copyable_int> >; , 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; struct boost_container_small_vector;

View File

@@ -12,9 +12,7 @@
#include <memory> #include <memory>
#include <boost/container/stable_vector.hpp> #include <boost/container/stable_vector.hpp>
#include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp> #include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include "check_equal_containers.hpp" #include "check_equal_containers.hpp"
#include "movable_int.hpp" #include "movable_int.hpp"
@@ -32,23 +30,9 @@ namespace boost {
namespace container { namespace container {
//Explicit instantiation to detect compilation errors //Explicit instantiation to detect compilation errors
template class stable_vector<test::movable_and_copyable_int,
test::dummy_test_allocator<test::movable_and_copyable_int> >;
template class stable_vector<test::movable_and_copyable_int, template class stable_vector<test::movable_and_copyable_int,
test::simple_allocator<test::movable_and_copyable_int> >; test::simple_allocator<test::movable_and_copyable_int> >;
template class stable_vector<test::movable_and_copyable_int,
std::allocator<test::movable_and_copyable_int> >;
template class stable_vector
< test::movable_and_copyable_int
, allocator<test::movable_and_copyable_int> >;
template class stable_vector
< test::movable_and_copyable_int
, adaptive_pool<test::movable_and_copyable_int> >;
template class stable_vector template class stable_vector
< test::movable_and_copyable_int < test::movable_and_copyable_int
, node_allocator<test::movable_and_copyable_int> >; , node_allocator<test::movable_and_copyable_int> >;
@@ -159,21 +143,11 @@ int main()
std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::allocator
if(test_cont_variants< allocator<void> >()){
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::node_allocator // boost::container::node_allocator
if(test_cont_variants< node_allocator<void> >()){ if(test_cont_variants< node_allocator<void> >()){
std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::adaptive_pool
if(test_cont_variants< adaptive_pool<void> >()){
std::cerr << "test_cont_variants< adaptive_pool<void> > failed" << std::endl;
return 1;
}
//////////////////////////////////// ////////////////////////////////////
// Default init test // Default init test

View File

@@ -28,27 +28,25 @@
using namespace boost::container; using namespace boost::container;
typedef test::dummy_test_allocator<char> DummyCharAllocator; typedef test::simple_allocator<char> SimpleCharAllocator;
typedef basic_string<char, std::char_traits<char>, DummyCharAllocator> DummyString; typedef basic_string<char, std::char_traits<char>, SimpleCharAllocator> SimpleString;
typedef test::dummy_test_allocator<DummyString> DummyStringAllocator; typedef test::simple_allocator<SimpleString> SimpleStringAllocator;
typedef test::dummy_test_allocator<wchar_t> DummyWCharAllocator; typedef test::simple_allocator<wchar_t> SimpleWCharAllocator;
typedef basic_string<wchar_t, std::char_traits<wchar_t>, DummyWCharAllocator> DummyWString; typedef basic_string<wchar_t, std::char_traits<wchar_t>, SimpleWCharAllocator> SimpleWString;
typedef test::dummy_test_allocator<DummyWString> DummyWStringAllocator; typedef test::simple_allocator<SimpleWString> SimpleWStringAllocator;
namespace boost { namespace boost {
namespace container { namespace container {
//Explicit instantiations of container::basic_string //Explicit instantiations of container::basic_string
template class basic_string<char, std::char_traits<char>, DummyCharAllocator>; template class basic_string<char, std::char_traits<char>, SimpleCharAllocator>;
template class basic_string<wchar_t, std::char_traits<wchar_t>, DummyWCharAllocator>; template class basic_string<wchar_t, std::char_traits<wchar_t>, SimpleWCharAllocator>;
template class basic_string<char, std::char_traits<char>, test::simple_allocator<char> >;
template class basic_string<wchar_t, std::char_traits<wchar_t>, test::simple_allocator<wchar_t> >;
template class basic_string<char, std::char_traits<char>, std::allocator<char> >; template class basic_string<char, std::char_traits<char>, std::allocator<char> >;
template class basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >; template class basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >;
//Explicit instantiation of container::vectors of container::strings //Explicit instantiation of container::vectors of container::strings
template class vector<DummyString, DummyStringAllocator>; template class vector<SimpleString, SimpleStringAllocator>;
template class vector<DummyWString, DummyWStringAllocator>; template class vector<SimpleWString, SimpleWStringAllocator>;
}} }}

View File

@@ -12,8 +12,6 @@
#include <boost/container/vector.hpp> #include <boost/container/vector.hpp>
#include <boost/container/allocator.hpp> #include <boost/container/allocator.hpp>
#include <boost/container/node_allocator.hpp>
#include <boost/container/adaptive_pool.hpp>
#include <boost/move/utility_core.hpp> #include <boost/move/utility_core.hpp>
#include "check_equal_containers.hpp" #include "check_equal_containers.hpp"
@@ -36,26 +34,10 @@ template class boost::container::vector
< test::movable_and_copyable_int < test::movable_and_copyable_int
, test::simple_allocator<test::movable_and_copyable_int> >; , test::simple_allocator<test::movable_and_copyable_int> >;
template class boost::container::vector
< test::movable_and_copyable_int
, test::dummy_test_allocator<test::movable_and_copyable_int> >;
template class boost::container::vector
< test::movable_and_copyable_int
, std::allocator<test::movable_and_copyable_int> >;
template class boost::container::vector template class boost::container::vector
< test::movable_and_copyable_int < test::movable_and_copyable_int
, allocator<test::movable_and_copyable_int> >; , allocator<test::movable_and_copyable_int> >;
template class boost::container::vector
< test::movable_and_copyable_int
, adaptive_pool<test::movable_and_copyable_int> >;
template class boost::container::vector
< test::movable_and_copyable_int
, node_allocator<test::movable_and_copyable_int> >;
namespace container_detail { namespace container_detail {
#ifndef BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER #ifndef BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER
@@ -210,16 +192,6 @@ int main()
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl; std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
return 1; return 1;
} }
// boost::container::node_allocator
if(test_cont_variants< node_allocator<void> >()){
std::cerr << "test_cont_variants< node_allocator<void> > failed" << std::endl;
return 1;
}
// boost::container::adaptive_pool
if(test_cont_variants< adaptive_pool<void> >()){
std::cerr << "test_cont_variants< adaptive_pool<void> > failed" << std::endl;
return 1;
}
{ {
typedef vector<Test, std::allocator<Test> > MyEnumCont; typedef vector<Test, std::allocator<Test> > MyEnumCont;