Simplify noinit_adaptor using allocator_access

This commit is contained in:
Glen Fernandes committed 2020-05-23 12:26:33 -04:00
1 parent 15db54983b
commit 6a33e879dd
2 files changed
+10 -44

No files matched your search

+2 -11
View File
@@ -71,8 +71,7 @@ struct noinit_adaptor
: A {
template<class U>
struct rebind {
typedef noinit_adaptor<typename std::allocator_traits<A>::template
rebind_alloc<U> > other;
typedef noinit_adaptor<allocator_rebind_t<A, U> > other;
};
noinit_adaptor() noexcept;
@@ -86,9 +85,6 @@ struct noinit_adaptor
template<class U>
void construct(U* p);
template<class U, class V, class... Args>
void construct(U* p, V&& v, Args&&... args);
template<class U>
void destroy(U* p);
};
@@ -121,7 +117,7 @@ noinit_adaptor<A> noinit_adapt(const A& a) noexcept;
[[variablelist
[[Requires][`A` shall be constructible from `U`.]]
[[Effects][Initializes the `A` base class with
`static_cast<const U&>(u)`.]]]]]]
`static_cast<const A&>(u)`.]]]]]]
[endsect]
@@ -131,11 +127,6 @@ noinit_adaptor<A> noinit_adapt(const A& a) noexcept;
[[`template<class U> void construct(U* p);`]
[[variablelist
[[Effects][`::new((void*)p) U`.]]]]]
[[`template<class U, class V, class... Args> void construct(U* p, V&& v,
Args&&... args);`]
[[variablelist
[[Effects][`::new(void*)p) U(std::forward<V>(v),
std::forward<Args>(args)...)`.]]]]]
[[`template<class U> void destroy(U* p);`]
[[variablelist
[[Effects][`p->~U()`.]]]]]]