forked from boostorg/unordered
Merge in some changes to the unordered tests.
[SVN r42856]
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <map>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/unordered/detail/allocator.hpp>
|
||||
#include <boost/mpl/aux_/config/eti.hpp>
|
||||
#include "../helpers/test.hpp"
|
||||
|
||||
namespace test
|
||||
@@ -56,14 +58,28 @@ namespace test
|
||||
}
|
||||
};
|
||||
|
||||
struct default_allocator_holder { template <class T> struct apply {
|
||||
typedef std::allocator<T> type; }; };
|
||||
|
||||
template <class AllocatorHolder = default_allocator_holder>
|
||||
struct memory_tracker {
|
||||
template <class Alloc>
|
||||
struct allocator_memory_type_gen {
|
||||
typedef std::map<memory_area, memory_track, memory_area_compare,
|
||||
BOOST_DEDUCED_TYPENAME boost::mpl::apply1<AllocatorHolder, std::pair<memory_area const, memory_track> >::type
|
||||
> allocated_memory_type;
|
||||
Alloc> type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
|
||||
template <>
|
||||
struct allocator_memory_type_gen<int> {
|
||||
typedef std::map<memory_area, memory_track, memory_area_compare> type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <class Alloc = std::allocator<int> >
|
||||
struct memory_tracker {
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
boost::unordered_detail::rebind_wrap<Alloc,
|
||||
std::pair<memory_area const, memory_track> >::type
|
||||
allocator_type;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME allocator_memory_type_gen<allocator_type>::type
|
||||
allocated_memory_type;
|
||||
|
||||
allocated_memory_type allocated_memory;
|
||||
unsigned int count_allocators;
|
||||
|
||||
Reference in New Issue
Block a user