mirror of
https://github.com/BlackMATov/flat.hpp.git
synced 2025-12-13 01:36:27 +07:00
fix gcc 4.9 unit test compilation
This commit is contained in:
@@ -17,8 +17,20 @@ namespace
|
||||
template < typename T >
|
||||
class dummy_allocator {
|
||||
public:
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using pointer = T*;
|
||||
using const_pointer = const T*;
|
||||
using reference = T&;
|
||||
using const_reference = const T&;
|
||||
using value_type = T;
|
||||
|
||||
using propagate_on_container_move_assignment = std::true_type;
|
||||
using is_always_equal = std::true_type;
|
||||
|
||||
template < typename U >
|
||||
struct rebind { using other = dummy_allocator<U>; };
|
||||
|
||||
dummy_allocator() = default;
|
||||
dummy_allocator(int i) : i(i) {}
|
||||
|
||||
@@ -36,6 +48,15 @@ namespace
|
||||
std::free(p);
|
||||
}
|
||||
|
||||
template < typename U, typename... Args >
|
||||
void construct(U* p, Args&&... args) {
|
||||
::new((void*)p) U(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void destroy(pointer p) {
|
||||
p->~T();
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -17,8 +17,20 @@ namespace
|
||||
template < typename T >
|
||||
class dummy_allocator {
|
||||
public:
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using pointer = T*;
|
||||
using const_pointer = const T*;
|
||||
using reference = T&;
|
||||
using const_reference = const T&;
|
||||
using value_type = T;
|
||||
|
||||
using propagate_on_container_move_assignment = std::true_type;
|
||||
using is_always_equal = std::true_type;
|
||||
|
||||
template < typename U >
|
||||
struct rebind { using other = dummy_allocator<U>; };
|
||||
|
||||
dummy_allocator() = default;
|
||||
dummy_allocator(int i) : i(i) {}
|
||||
|
||||
@@ -36,6 +48,15 @@ namespace
|
||||
std::free(p);
|
||||
}
|
||||
|
||||
template < typename U, typename... Args >
|
||||
void construct(U* p, Args&&... args) {
|
||||
::new((void*)p) U(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void destroy(pointer p) {
|
||||
p->~T();
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user