Changes to support GCC 3.4

This commit is contained in:
Ion Gaztañaga
2015-10-12 18:51:08 +02:00
parent f8a4f01a86
commit 7764e05444
10 changed files with 45 additions and 33 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ class expand_bwd_test_allocator
{ typedef expand_bwd_test_allocator<T2> other; };
//!Constructor from the segment manager. Never throws
expand_bwd_test_allocator(T *buffer, size_type sz, difference_type offset)
expand_bwd_test_allocator(T *buffer = 0, size_type sz = 0, difference_type offset = 0)
: mp_buffer(buffer), m_size(sz)
, m_offset(offset), m_allocations(0){ }
+4
View File
@@ -92,6 +92,10 @@ struct stateful
struct rebind
{ typedef stateful other; };
stateful()
: m_u(0u)
{}
char *allocate(std::size_t n)
{ allocate_size = n; return allocate_return; }
+5 -3
View File
@@ -31,7 +31,7 @@ class SimpleAllocator
public:
typedef Ty value_type;
explicit SimpleAllocator(int value)
explicit SimpleAllocator(int value = 0)
: m_state(value)
{}
@@ -356,7 +356,8 @@ bool one_level_allocator_propagation_test()
typedef typename ContainerWrapper::allocator_type allocator_type;
typedef typename ContainerWrapper::value_type value_type;
{
ContainerWrapper c(allocator_type(SimpleAllocator<value_type>(5)));
allocator_type al(SimpleAllocator<value_type>(5));
ContainerWrapper c(al);
c.clear();
iterator it = c.emplace(c.cbegin(), 42);
@@ -365,7 +366,8 @@ bool one_level_allocator_propagation_test()
return false;
}
{
ContainerWrapper c2(allocator_type(SimpleAllocator<value_type>(4)));
allocator_type al(SimpleAllocator<value_type>(4));
ContainerWrapper c2(al);
ContainerWrapper c(::boost::move(c2), allocator_type(SimpleAllocator<value_type>(5)));
c.clear();
+3
View File
@@ -95,6 +95,9 @@ int test_expand_bwd()
class recursive_vector
{
public:
recursive_vector & operator=(const recursive_vector &x)
{ this->vector_ = x.vector_; return *this; }
int id_;
vector<recursive_vector> vector_;
vector<recursive_vector>::iterator it_;