Revise allocator_access implementation

This commit is contained in:
Glen Fernandes
2020-05-25 15:00:18 -04:00
parent 65901249d5
commit 376aa7aa31
22 changed files with 562 additions and 582 deletions

View File

@@ -8,23 +8,22 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/allocator_access.hpp>
#include <boost/core/lightweight_test.hpp>
template<class T>
struct A {
typedef int* pointer;
typedef int size_type;
typedef T value_type;
typedef T* pointer;
typedef std::size_t size_type;
A()
: value() { }
void deallocate(pointer, size_type n) {
void deallocate(T*, std::size_t n) {
value = n;
}
size_type value;
std::size_t value;
};
int main()
{
A a;
A<int> a;
boost::allocator_deallocate(a, 0, 5);
BOOST_TEST_EQ(a.value, 5);
return boost::report_errors();