From Jason Turner

[memory.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpfeenreot/{from.md → to.md} +13 -2
tmp/tmpfeenreot/{from.md → to.md} RENAMED
@@ -3,11 +3,11 @@
3
  The header `<memory>` defines several types and function templates that
4
  describe properties of pointers and pointer-like types, manage memory
5
  for containers and other template types, and construct multiple objects
6
  in uninitialized memory buffers ([[pointer.traits]]–
7
  [[specialized.algorithms]]). The header also defines the templates
8
- `unique_ptr`, `shared_ptr`, `weak_ptr`, and various template functions
9
  that operate on objects of these types ([[smartptr]]).
10
 
11
  ``` cpp
12
  namespace std {
13
  // [pointer.traits], pointer traits
@@ -26,11 +26,11 @@ namespace std {
26
  void* align(std::size_t alignment, std::size_t size,
27
  void*& ptr, std::size_t& space);
28
 
29
  // [allocator.tag], allocator argument tag
30
  struct allocator_arg_t { };
31
- constexpr allocator_arg_t allocator_arg = allocator_arg_t();
32
 
33
  // [allocator.uses], uses_allocator
34
  template <class T, class Alloc> struct uses_allocator;
35
 
36
  // [allocator.traits], allocator traits
@@ -71,10 +71,16 @@ namespace std {
71
  template <class T> struct default_delete;
72
  template <class T> struct default_delete<T[]>;
73
  template <class T, class D = default_delete<T>> class unique_ptr;
74
  template <class T, class D> class unique_ptr<T[], D>;
75
 
 
 
 
 
 
 
76
  template <class T1, class D1, class T2, class D2>
77
  bool operator==(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y);
78
  template <class T1, class D1, class T2, class D2>
79
  bool operator!=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y);
80
  template <class T1, class D1, class T2, class D2>
@@ -115,10 +121,15 @@ namespace std {
115
  class bad_weak_ptr;
116
 
117
  // [util.smartptr.shared], class template shared_ptr:
118
  template<class T> class shared_ptr;
119
 
 
 
 
 
 
120
  // [util.smartptr.shared.cmp], shared_ptr comparisons:
121
  template<class T, class U>
122
  bool operator==(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
123
  template<class T, class U>
124
  bool operator!=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
 
3
  The header `<memory>` defines several types and function templates that
4
  describe properties of pointers and pointer-like types, manage memory
5
  for containers and other template types, and construct multiple objects
6
  in uninitialized memory buffers ([[pointer.traits]]–
7
  [[specialized.algorithms]]). The header also defines the templates
8
+ `unique_ptr`, `shared_ptr`, `weak_ptr`, and various function templates
9
  that operate on objects of these types ([[smartptr]]).
10
 
11
  ``` cpp
12
  namespace std {
13
  // [pointer.traits], pointer traits
 
26
  void* align(std::size_t alignment, std::size_t size,
27
  void*& ptr, std::size_t& space);
28
 
29
  // [allocator.tag], allocator argument tag
30
  struct allocator_arg_t { };
31
+ constexpr allocator_arg_t allocator_arg{};
32
 
33
  // [allocator.uses], uses_allocator
34
  template <class T, class Alloc> struct uses_allocator;
35
 
36
  // [allocator.traits], allocator traits
 
71
  template <class T> struct default_delete;
72
  template <class T> struct default_delete<T[]>;
73
  template <class T, class D = default_delete<T>> class unique_ptr;
74
  template <class T, class D> class unique_ptr<T[], D>;
75
 
76
+ template <class T, class... Args> unique_ptr<T> make_unique(Args&&... args);
77
+ template <class T> unique_ptr<T> make_unique(size_t n);
78
+ template <class T, class... Args> unspecified make_unique(Args&&...) = delete;
79
+
80
+ template <class T, class D> void swap(unique_ptr<T, D>& x, unique_ptr<T, D>& y) noexcept;
81
+
82
  template <class T1, class D1, class T2, class D2>
83
  bool operator==(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y);
84
  template <class T1, class D1, class T2, class D2>
85
  bool operator!=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y);
86
  template <class T1, class D1, class T2, class D2>
 
121
  class bad_weak_ptr;
122
 
123
  // [util.smartptr.shared], class template shared_ptr:
124
  template<class T> class shared_ptr;
125
 
126
+ // [util.smartptr.shared.create], shared_ptr creation
127
+ template<class T, class... Args> shared_ptr<T> make_shared(Args&&... args);
128
+ template<class T, class A, class... Args>
129
+ shared_ptr<T> allocate_shared(const A& a, Args&&... args);
130
+
131
  // [util.smartptr.shared.cmp], shared_ptr comparisons:
132
  template<class T, class U>
133
  bool operator==(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
134
  template<class T, class U>
135
  bool operator!=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;