From Jason Turner

[allocator.members]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpuwaku4uz/{from.md → to.md} +6 -49
tmp/tmpuwaku4uz/{from.md → to.md} RENAMED
@@ -6,73 +6,30 @@ concurrent calls to those member functions from different threads. Calls
6
  to these functions that allocate or deallocate a particular unit of
7
  storage shall occur in a single total order, and each such deallocation
8
  call shall happen before the next allocation (if any) in this order.
9
 
10
  ``` cpp
11
- pointer address(reference x) const noexcept;
12
  ```
13
 
14
- *Returns:* The actual address of the object referenced by `x`, even in
15
- the presence of an overloaded operator&.
16
-
17
- ``` cpp
18
- const_pointer address(const_reference x) const noexcept;
19
- ```
20
-
21
- *Returns:* The actual address of the object referenced by `x`, even in
22
- the presence of an overloaded operator&.
23
-
24
- ``` cpp
25
- pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
26
- ```
27
-
28
- In a container member function, the address of an adjacent element is
29
- often a good choice to pass for the `hint` argument.
30
-
31
  *Returns:* A pointer to the initial element of an array of storage of
32
  size `n` `* sizeof(T)`, aligned appropriately for objects of type `T`.
33
- It is *implementation-defined* whether over-aligned types are
34
- supported ([[basic.align]]).
35
 
36
- the storage is obtained by calling
37
- `::operator new(std::size_t)` ([[new.delete]]), but it is unspecified
38
- when or how often this function is called. The use of `hint` is
39
- unspecified, but intended as an aid to locality if an implementation so
40
- desires.
41
 
42
  *Throws:* `bad_alloc` if the storage cannot be obtained.
43
 
44
  ``` cpp
45
- void deallocate(pointer p, size_type n);
46
  ```
47
 
48
  *Requires:* `p` shall be a pointer value obtained from `allocate()`. `n`
49
  shall equal the value passed as the first argument to the invocation of
50
  allocate which returned `p`.
51
 
52
  *Effects:* Deallocates the storage referenced by `p` .
53
 
54
- *Remarks:* Uses
55
- `::operator delete(void*, std::size_t)` ([[new.delete]]), but it is
56
  unspecified when this function is called.
57
 
58
- ``` cpp
59
- size_type max_size() const noexcept;
60
- ```
61
-
62
- *Returns:* The largest value *N* for which the call `allocate(N,0)`
63
- might succeed.
64
-
65
- ``` cpp
66
- template <class U, class... Args>
67
- void construct(U* p, Args&&... args);
68
- ```
69
-
70
- *Effects:* `::new((void *)p) U(std::forward<Args>(args)...)`
71
-
72
- ``` cpp
73
- template <class U>
74
- void destroy(U* p);
75
- ```
76
-
77
- *Effects:* `p->~U()`
78
-
 
6
  to these functions that allocate or deallocate a particular unit of
7
  storage shall occur in a single total order, and each such deallocation
8
  call shall happen before the next allocation (if any) in this order.
9
 
10
  ``` cpp
11
+ T* allocate(size_t n);
12
  ```
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  *Returns:* A pointer to the initial element of an array of storage of
15
  size `n` `* sizeof(T)`, aligned appropriately for objects of type `T`.
 
 
16
 
17
+ *Remarks:* the storage is obtained by calling
18
+ `::operator new` ([[new.delete]]), but it is unspecified when or how
19
+ often this function is called.
 
 
20
 
21
  *Throws:* `bad_alloc` if the storage cannot be obtained.
22
 
23
  ``` cpp
24
+ void deallocate(T* p, size_t n);
25
  ```
26
 
27
  *Requires:* `p` shall be a pointer value obtained from `allocate()`. `n`
28
  shall equal the value passed as the first argument to the invocation of
29
  allocate which returned `p`.
30
 
31
  *Effects:* Deallocates the storage referenced by `p` .
32
 
33
+ *Remarks:* Uses `::operator delete` ([[new.delete]]), but it is
 
34
  unspecified when this function is called.
35