46#ifndef _RWSTD_RW_ALLOCATOR_H_INCLUDED
47#define _RWSTD_RW_ALLOCATOR_H_INCLUDED
49#ifndef _RWSTD_SPECIALIZED_H_INCLUDED
58_RWSTD_EXPORT void __rw_deallocate (
void*, _RWSTD_SIZE_T,
int = 0);
66#ifndef _RWSTD_NO_EXT_CXX_0X
68struct allocator_arg_t { };
70const allocator_arg_t allocator_arg = allocator_arg_t ();
75template <
class _TypeT>
class
83 typedef void value_type;
84 typedef value_type* pointer;
85 typedef const value_type* const_pointer;
88#ifdef _RWSTD_ALLOCATOR
90 template <
class _TypeU>
92 typedef allocator<_TypeU> other;
100template <
class _TypeT>
104 typedef _RWSTD_SIZE_T size_type;
105 typedef _RWSTD_PTRDIFF_T difference_type;
106 typedef _TypeT value_type;
107 typedef value_type* pointer;
108 typedef const value_type* const_pointer;
109 typedef value_type& reference;
110 typedef const value_type& const_reference;
114 allocator (
const allocator &__rhs)
_THROWS (()) {
119#ifdef _RWSTD_ALLOCATOR
121 template <
class _TypeU>
123 typedef allocator<_TypeU> other;
126 template <
class _TypeU>
127 allocator (
const allocator<_TypeU>&)
_THROWS (()) { }
129 template <
class _TypeU>
131 operator= (
const allocator<_TypeU>&)
_THROWS (()) {
138 pointer address (reference __x)
const {
144 const_pointer address (const_reference __x)
const {
150 pointer allocate (size_type __n, allocator<void>::const_pointer = 0) {
152#ifdef _RWSTD_ALLOCATOR
154 _RW::__rw_allocate (__n *
sizeof (value_type)));
160#ifdef _RWSTD_ALLOCATOR
161 void deallocate (pointer __p, size_type __n)
163 void deallocate (
void* __p, size_type __n)
166 _RW::__rw_deallocate (__p, __n);
170 size_type max_size ()
const _THROWS (()) {
171 return size_type (_RWSTD_SIZE_MAX) /
sizeof (value_type)
172 ? size_type (size_type (_RWSTD_SIZE_MAX) /
sizeof (value_type))
176 void construct (pointer __p, const_reference __val) {
177 _RW::__rw_construct (__p, __val);
180 void destroy (pointer __p) {
187#if !defined (_RWSTD_NO_CLASS_PARTIAL_SPEC) \
188 && !defined (_RWSTD_NO_EXT_CONST_ALLOCATOR)
192template <
class _TypeT>
193class allocator<const _TypeT>
196 typedef _RWSTD_SIZE_T size_type;
197 typedef _RWSTD_PTRDIFF_T difference_type;
198 typedef const _TypeT value_type;
199 typedef const value_type* pointer;
200 typedef const value_type* const_pointer;
201 typedef const value_type& reference;
202 typedef const value_type& const_reference;
206 allocator (
const allocator &__rhs)
_THROWS (()) {
211#ifdef _RWSTD_ALLOCATOR
213 template <
class _TypeU>
215 typedef allocator<_TypeU> other;
218 template <
class _TypeU>
219 allocator (
const allocator<_TypeU>&)
_THROWS (()) { }
221 template <
class _TypeU>
222 allocator& operator= (
const allocator<_TypeU>&)
_THROWS (()) {
228 const_pointer address (const_reference __x)
const {
236 const_pointer allocate (size_type __n,
const void* = 0) {
238#ifdef _RWSTD_ALLOCATOR
241 _RW::__rw_allocate (__n *
sizeof (value_type))));
245 _RW::__rw_allocate (__n)));
250#ifdef _RWSTD_ALLOCATOR
251 void deallocate (const_pointer __p, size_type __nelems) {
255 void deallocate (
const void* __p, size_type __nbytes) {
261 size_type max_size ()
const _THROWS (()) {
262 return size_type (_RWSTD_SIZE_MAX) /
sizeof (value_type)
263 ? size_type (size_type (_RWSTD_SIZE_MAX) /
sizeof (value_type))
267 void construct (const_pointer __p, const_reference __val) {
271 void destroy (const_pointer __p) {
292#ifndef _RWSTD_ALLOCATOR
294template <
class _Allocator,
class _TypeT>
295class allocator_interface
298 typedef _Allocator allocator_type;
299 typedef _TypeT value_type;
300 typedef value_type* pointer;
301 typedef const value_type* const_pointer;
302 typedef value_type& reference;
303 typedef const value_type& const_reference;
304 typedef typename allocator_type::size_type size_type;
305 typedef typename allocator_type::difference_type difference_type;
308 allocator_type _C_alloc;
311 allocator_interface()
_THROWS (()) { }
313 allocator_interface (
const allocator_type &__alloc)
_THROWS (())
314 : _C_alloc (__alloc) { }
316 operator allocator_type& () {
320 pointer address (reference __x)
const {
326 const_pointer address (const_reference __x)
const {
332 size_type max_size ()
const {
333 return _C_alloc.max_size () /
sizeof (value_type);
336 pointer allocate (size_type __n,
const void* __p = 0) {
337 return (pointer)_C_alloc.allocate (__n *
sizeof (value_type), __p);
340 void deallocate (pointer __p, size_type __n) {
341 _C_alloc.deallocate (__p, __n);
344 void construct (pointer __p, const_reference __val) {
345 _RW::__rw_construct(__p, __val);
348 void destroy (pointer __p)
const {
356class allocator_interface<allocator<void>, void>
359 typedef allocator<void> allocator_type;
360 typedef void* pointer;
361 typedef const void* const_pointer;
362 typedef void value_type;
365 allocator_type _C_alloc;
368 allocator_interface ()
_THROWS (()) { }
370 allocator_interface (
const allocator<void>& __rhs)
_THROWS (())
371 : _C_alloc (__rhs) { }
376template <
class _TypeT,
class _TypeU,
class _TypeV,
class _TypeW>
378operator== (
const allocator_interface<_TypeT, _TypeU>&,
379 const allocator_interface<_TypeV, _TypeW>&)
_THROWS (())
387template <
class _TypeT,
class _TypeU>
395#ifndef _RWSTD_NO_NAMESPACE
397template <
class _TypeT,
class _TypeU>
400 const allocator<_TypeU>& __y)
_THROWS (())
402 return !(__x == __y);
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_REINTERPRET_CAST(T, x)
#define _RWSTD_UNUSED(arg)
#define _RWSTD_STATIC_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ASSERT(ignore)
#define _RWSTD_CONST_CAST(T, x)
bool operator==(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept