mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-07-22 03:44:27 +08:00
refs #72, filesystem_test issues with TestAllocator
This commit is contained in:
parent
a9302df045
commit
f31b5baac4
@ -266,17 +266,19 @@ class TestAllocator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using value_type = T;
|
using value_type = T;
|
||||||
|
using pointer = T*;
|
||||||
|
using const_pointer = const T*;
|
||||||
|
using reference = T&;
|
||||||
|
using const_reference = const T&;
|
||||||
|
using difference_type = ptrdiff_t;
|
||||||
|
using size_type = size_t;
|
||||||
TestAllocator() noexcept {}
|
TestAllocator() noexcept {}
|
||||||
template <class U>
|
template <class U>
|
||||||
TestAllocator(TestAllocator<U> const&) noexcept
|
TestAllocator(TestAllocator<U> const&) noexcept
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
value_type* allocate(std::size_t n) { return static_cast<value_type*>(::operator new(n * sizeof(value_type))); }
|
value_type* allocate(std::size_t n) { return static_cast<value_type*>(::operator new(n * sizeof(value_type))); }
|
||||||
|
|
||||||
void deallocate(value_type* p, std::size_t) noexcept { ::operator delete(p); }
|
void deallocate(value_type* p, std::size_t) noexcept { ::operator delete(p); }
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
struct rebind {
|
struct rebind {
|
||||||
typedef TestAllocator<U> other;
|
typedef TestAllocator<U> other;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user