From Jason Turner

[allocator.traits.members]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpk4dtewcr/{from.md → to.md} +10 -10
tmp/tmpk4dtewcr/{from.md → to.md} RENAMED
@@ -1,54 +1,54 @@
1
- #### Allocator traits static member functions <a id="allocator.traits.members">[[allocator.traits.members]]</a>
2
 
3
  ``` cpp
4
- static pointer allocate(Alloc& a, size_type n);
5
  ```
6
 
7
  *Returns:* `a.allocate(n)`.
8
 
9
  ``` cpp
10
- static pointer allocate(Alloc& a, size_type n, const_void_pointer hint);
11
  ```
12
 
13
  *Returns:* `a.allocate(n, hint)` if that expression is well-formed;
14
  otherwise, `a.allocate(n)`.
15
 
16
  ``` cpp
17
- static void deallocate(Alloc& a, pointer p, size_type n);
18
  ```
19
 
20
  *Effects:* Calls `a.deallocate(p, n)`.
21
 
22
  *Throws:* Nothing.
23
 
24
  ``` cpp
25
  template<class T, class... Args>
26
- static void construct(Alloc& a, T* p, Args&&... args);
27
  ```
28
 
29
  *Effects:* Calls `a.construct(p, std::forward<Args>(args)...)` if that
30
  call is well-formed; otherwise, invokes
31
- `::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)`.
32
 
33
  ``` cpp
34
  template<class T>
35
- static void destroy(Alloc& a, T* p);
36
  ```
37
 
38
  *Effects:* Calls `a.destroy(p)` if that call is well-formed; otherwise,
39
- invokes `p->~T()`.
40
 
41
  ``` cpp
42
- static size_type max_size(const Alloc& a) noexcept;
43
  ```
44
 
45
  *Returns:* `a.max_size()` if that expression is well-formed; otherwise,
46
  `numeric_limits<size_type>::max()/sizeof(value_type)`.
47
 
48
  ``` cpp
49
- static Alloc select_on_container_copy_construction(const Alloc& rhs);
50
  ```
51
 
52
  *Returns:* `rhs.select_on_container_copy_construction()` if that
53
  expression is well-formed; otherwise, `rhs`.
54
 
 
1
+ #### Static member functions <a id="allocator.traits.members">[[allocator.traits.members]]</a>
2
 
3
  ``` cpp
4
+ [[nodiscard]] static constexpr pointer allocate(Alloc& a, size_type n);
5
  ```
6
 
7
  *Returns:* `a.allocate(n)`.
8
 
9
  ``` cpp
10
+ [[nodiscard]] static constexpr pointer allocate(Alloc& a, size_type n, const_void_pointer hint);
11
  ```
12
 
13
  *Returns:* `a.allocate(n, hint)` if that expression is well-formed;
14
  otherwise, `a.allocate(n)`.
15
 
16
  ``` cpp
17
+ static constexpr void deallocate(Alloc& a, pointer p, size_type n);
18
  ```
19
 
20
  *Effects:* Calls `a.deallocate(p, n)`.
21
 
22
  *Throws:* Nothing.
23
 
24
  ``` cpp
25
  template<class T, class... Args>
26
+ static constexpr void construct(Alloc& a, T* p, Args&&... args);
27
  ```
28
 
29
  *Effects:* Calls `a.construct(p, std::forward<Args>(args)...)` if that
30
  call is well-formed; otherwise, invokes
31
+ `construct_at(p, std::forward<Args>(args)...)`.
32
 
33
  ``` cpp
34
  template<class T>
35
+ static constexpr void destroy(Alloc& a, T* p);
36
  ```
37
 
38
  *Effects:* Calls `a.destroy(p)` if that call is well-formed; otherwise,
39
+ invokes `destroy_at(p)`.
40
 
41
  ``` cpp
42
+ static constexpr size_type max_size(const Alloc& a) noexcept;
43
  ```
44
 
45
  *Returns:* `a.max_size()` if that expression is well-formed; otherwise,
46
  `numeric_limits<size_type>::max()/sizeof(value_type)`.
47
 
48
  ``` cpp
49
+ static constexpr Alloc select_on_container_copy_construction(const Alloc& rhs);
50
  ```
51
 
52
  *Returns:* `rhs.select_on_container_copy_construction()` if that
53
  expression is well-formed; otherwise, `rhs`.
54