tmp/tmpfv_57r_u/{from.md → to.md}
RENAMED
|
@@ -27,41 +27,44 @@ allocator is the outer allocator for use by the container, the second
|
|
| 27 |
allocator is passed to the constructors of the container’s elements,
|
| 28 |
and, if the elements themselves are containers, the third allocator is
|
| 29 |
passed to the elements’ elements, and so on. If containers are nested to
|
| 30 |
a depth greater than the number of allocators, the last allocator is
|
| 31 |
used repeatedly, as in the single-allocator case, for any remaining
|
| 32 |
-
recursions.
|
|
|
|
|
|
|
| 33 |
allocator type so it can be substituted for the outer allocator type in
|
| 34 |
-
most expressions.
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
namespace std {
|
| 38 |
template <class OuterAlloc, class... InnerAllocs>
|
| 39 |
class scoped_allocator_adaptor : public OuterAlloc {
|
| 40 |
private:
|
| 41 |
-
|
| 42 |
scoped_allocator_adaptor<InnerAllocs...> inner; // exposition only
|
| 43 |
public:
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
| 58 |
|
| 59 |
template <class Tp>
|
| 60 |
struct rebind {
|
| 61 |
-
|
| 62 |
-
OuterTraits::template rebind_alloc<Tp>, InnerAllocs...>
|
| 63 |
};
|
| 64 |
|
| 65 |
scoped_allocator_adaptor();
|
| 66 |
template <class OuterA2>
|
| 67 |
scoped_allocator_adaptor(OuterA2&& outerAlloc,
|
|
@@ -75,10 +78,13 @@ namespace std {
|
|
| 75 |
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other) noexcept;
|
| 76 |
template <class OuterA2>
|
| 77 |
scoped_allocator_adaptor(
|
| 78 |
scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept;
|
| 79 |
|
|
|
|
|
|
|
|
|
|
| 80 |
~scoped_allocator_adaptor();
|
| 81 |
|
| 82 |
inner_allocator_type& inner_allocator() noexcept;
|
| 83 |
const inner_allocator_type& inner_allocator() const noexcept;
|
| 84 |
outer_allocator_type& outer_allocator() noexcept;
|
|
@@ -107,10 +113,14 @@ namespace std {
|
|
| 107 |
void destroy(T* p);
|
| 108 |
|
| 109 |
scoped_allocator_adaptor select_on_container_copy_construction() const;
|
| 110 |
};
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
| 113 |
bool operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
| 114 |
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
|
| 115 |
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
| 116 |
bool operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
|
|
|
| 27 |
allocator is passed to the constructors of the container’s elements,
|
| 28 |
and, if the elements themselves are containers, the third allocator is
|
| 29 |
passed to the elements’ elements, and so on. If containers are nested to
|
| 30 |
a depth greater than the number of allocators, the last allocator is
|
| 31 |
used repeatedly, as in the single-allocator case, for any remaining
|
| 32 |
+
recursions.
|
| 33 |
+
|
| 34 |
+
[*Note 1*: The `scoped_allocator_adaptor` is derived from the outer
|
| 35 |
allocator type so it can be substituted for the outer allocator type in
|
| 36 |
+
most expressions. — *end note*]
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
namespace std {
|
| 40 |
template <class OuterAlloc, class... InnerAllocs>
|
| 41 |
class scoped_allocator_adaptor : public OuterAlloc {
|
| 42 |
private:
|
| 43 |
+
using OuterTraits = allocator_traits<OuterAlloc>; // exposition only
|
| 44 |
scoped_allocator_adaptor<InnerAllocs...> inner; // exposition only
|
| 45 |
public:
|
| 46 |
+
using outer_allocator_type = OuterAlloc;
|
| 47 |
+
using inner_allocator_type = see below;
|
| 48 |
|
| 49 |
+
using value_type = typename OuterTraits::value_type;
|
| 50 |
+
using size_type = typename OuterTraits::size_type;
|
| 51 |
+
using difference_type = typename OuterTraits::difference_type;
|
| 52 |
+
using pointer = typename OuterTraits::pointer;
|
| 53 |
+
using const_pointer = typename OuterTraits::const_pointer;
|
| 54 |
+
using void_pointer = typename OuterTraits::void_pointer;
|
| 55 |
+
using const_void_pointer = typename OuterTraits::const_void_pointer;
|
| 56 |
|
| 57 |
+
using propagate_on_container_copy_assignment = see below;
|
| 58 |
+
using propagate_on_container_move_assignment = see below;
|
| 59 |
+
using propagate_on_container_swap = see below;
|
| 60 |
+
using is_always_equal = see below;
|
| 61 |
|
| 62 |
template <class Tp>
|
| 63 |
struct rebind {
|
| 64 |
+
using other = scoped_allocator_adaptor<
|
| 65 |
+
OuterTraits::template rebind_alloc<Tp>, InnerAllocs...>;
|
| 66 |
};
|
| 67 |
|
| 68 |
scoped_allocator_adaptor();
|
| 69 |
template <class OuterA2>
|
| 70 |
scoped_allocator_adaptor(OuterA2&& outerAlloc,
|
|
|
|
| 78 |
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other) noexcept;
|
| 79 |
template <class OuterA2>
|
| 80 |
scoped_allocator_adaptor(
|
| 81 |
scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept;
|
| 82 |
|
| 83 |
+
scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default;
|
| 84 |
+
scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default;
|
| 85 |
+
|
| 86 |
~scoped_allocator_adaptor();
|
| 87 |
|
| 88 |
inner_allocator_type& inner_allocator() noexcept;
|
| 89 |
const inner_allocator_type& inner_allocator() const noexcept;
|
| 90 |
outer_allocator_type& outer_allocator() noexcept;
|
|
|
|
| 113 |
void destroy(T* p);
|
| 114 |
|
| 115 |
scoped_allocator_adaptor select_on_container_copy_construction() const;
|
| 116 |
};
|
| 117 |
|
| 118 |
+
template<class OuterAlloc, class... InnerAllocs>
|
| 119 |
+
scoped_allocator_adaptor(OuterAlloc, InnerAllocs...)
|
| 120 |
+
-> scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>;
|
| 121 |
+
|
| 122 |
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
| 123 |
bool operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|
| 124 |
const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept;
|
| 125 |
template <class OuterA1, class OuterA2, class... InnerAllocs>
|
| 126 |
bool operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a,
|