| 1 |
typedef long unsigned int size_t; |
| 2 |
|
| 3 |
template<typename> class allocator; |
| 4 |
|
| 5 |
template<typename _Tp, typename _Up> |
| 6 |
struct __replace_first_arg |
| 7 |
{ }; |
| 8 |
|
| 9 |
template<template<typename, typename...> class _Template, typename _Up, |
| 10 |
typename _Tp, typename... _Types> |
| 11 |
struct __replace_first_arg<_Template<_Tp, _Types...>, _Up> |
| 12 |
{ |
| 13 |
using type = _Template<_Up, _Types...>; |
| 14 |
}; |
| 15 |
|
| 16 |
template<typename _Tp, typename _Up> |
| 17 |
using __replace_first_arg_t = typename __replace_first_arg<_Tp, _Up>::type; |
| 18 |
|
| 19 |
template<typename _Tp> |
| 20 |
class new_allocator |
| 21 |
{ |
| 22 |
public: |
| 23 |
typedef _Tp value_type; |
| 24 |
}; |
| 25 |
|
| 26 |
template<typename _Tp> |
| 27 |
using __allocator_base = new_allocator<_Tp>; |
| 28 |
|
| 29 |
template<typename _Tp> |
| 30 |
class allocator : public __allocator_base<_Tp> |
| 31 |
{ |
| 32 |
public: |
| 33 |
}; |
| 34 |
|
| 35 |
struct __allocator_traits_base |
| 36 |
{ |
| 37 |
template<typename _Tp, typename _Up, typename = void> |
| 38 |
struct __rebind : __replace_first_arg<_Tp, _Up> { }; |
| 39 |
}; |
| 40 |
|
| 41 |
template<typename _Alloc, typename _Up> |
| 42 |
using __alloc_rebind |
| 43 |
= typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type; |
| 44 |
|
| 45 |
template<typename _Alloc> |
| 46 |
struct allocator_traits : __allocator_traits_base |
| 47 |
{ |
| 48 |
public: |
| 49 |
template<typename _Tp> |
| 50 |
using rebind_alloc = __alloc_rebind<_Alloc, _Tp>; |
| 51 |
}; |
| 52 |
|
| 53 |
template<typename _Alloc, typename = typename _Alloc::value_type> |
| 54 |
struct __alloc_traits |
| 55 |
|
| 56 |
{ |
| 57 |
template<typename _Tp> |
| 58 |
struct rebind |
| 59 |
{ |
| 60 |
typedef typename allocator_traits<_Alloc>::template rebind_alloc<_Tp> other; |
| 61 |
}; |
| 62 |
}; |
| 63 |
|
| 64 |
typedef typename __alloc_traits<allocator<char>>::template |
| 65 |
rebind<char>::other _Char_alloc_type; |