Skip to content

Commit 0c1521c

Browse files
committed
Add missing stub <scoped_allocator>
1 parent 2e1637e commit 0c1521c

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <scoped_allocator.h>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#ifndef _GHLIBCPP_SCOPED_ALLOCATOR
2+
#define _GHLIBCPP_SCOPED_ALLOCATOR
3+
4+
#include <cstddef>
5+
#include <memory>
6+
7+
namespace std {
8+
9+
// =============================================================================
10+
// std::scoped_allocator_adaptor
11+
// =============================================================================
12+
13+
template <typename T1, typename... T2>
14+
class scoped_allocator_adaptor : public T1 {
15+
public:
16+
using outer_allocator_type = T1;
17+
using value_type = typename allocator_traits<T1>::value_type;
18+
using size_type = typename allocator_traits<T1>::size_type;
19+
using pointer = typename allocator_traits<T1>::pointer;
20+
using const_void_pointer = typename allocator_traits<T1>::const_void_pointer;
21+
22+
scoped_allocator_adaptor();
23+
scoped_allocator_adaptor(const scoped_allocator_adaptor &) noexcept;
24+
scoped_allocator_adaptor(scoped_allocator_adaptor &&) noexcept;
25+
26+
~scoped_allocator_adaptor() = default;
27+
28+
pointer allocate(size_type);
29+
pointer allocate(size_type, const_void_pointer);
30+
void deallocate(pointer, size_type);
31+
};
32+
33+
} // namespace std
34+
35+
#endif // _GHLIBCPP_SCOPED_ALLOCATOR

0 commit comments

Comments
 (0)