Skip to content

Commit 6e7624c

Browse files
committed
Headers: Add allocator<void>
1 parent 2ed5d30 commit 6e7624c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

headers/memory

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ public:
417417

418418
template<class T>
419419
struct allocator {
420-
// SIMPLIFIED: allocator<void> specialization is not provided
421420
typedef T value_type;
422421
typedef T* pointer;
423422
typedef const T* const_pointer;
@@ -463,6 +462,19 @@ struct allocator {
463462
void destroy(U* p);
464463
};
465464

465+
template<>
466+
struct allocator<void> {
467+
typedef void value_type;
468+
typedef void* pointer;
469+
typedef const void* const_pointer;
470+
#if CPPREFERENCE_STDVER>= 2014
471+
typedef true_type propagate_on_container_move_assignment;
472+
#endif
473+
template<class U> struct rebind {
474+
typedef allocator<U> other;
475+
};
476+
};
477+
466478
template<class T1, class T2>
467479
bool operator==(const allocator<T1>& lhs, const allocator<T2>& rhs);
468480

0 commit comments

Comments
 (0)