From Jason Turner

[specialized.destroy]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpuzyt290k/{from.md → to.md} +44 -7
tmp/tmpuzyt290k/{from.md → to.md} RENAMED
@@ -1,38 +1,75 @@
1
- #### `destroy` <a id="specialized.destroy">[[specialized.destroy]]</a>
2
 
3
  ``` cpp
4
  template<class T>
5
- void destroy_at(T* location);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  ```
7
 
8
  *Effects:* Equivalent to:
9
 
10
  ``` cpp
11
- location->~T();
 
12
  ```
13
 
14
  ``` cpp
15
- template <class ForwardIterator>
16
- void destroy(ForwardIterator first, ForwardIterator last);
 
 
 
 
 
 
17
  ```
18
 
19
  *Effects:* Equivalent to:
20
 
21
  ``` cpp
22
  for (; first != last; ++first)
23
  destroy_at(addressof(*first));
 
24
  ```
25
 
26
  ``` cpp
27
- template <class ForwardIterator, class Size>
28
- ForwardIterator destroy_n(ForwardIterator first, Size n);
29
  ```
30
 
31
  *Effects:* Equivalent to:
32
 
33
  ``` cpp
34
  for (; n > 0; (void)++first, --n)
35
  destroy_at(addressof(*first));
36
  return first;
37
  ```
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### `destroy` <a id="specialized.destroy">[[specialized.destroy]]</a>
2
 
3
  ``` cpp
4
  template<class T>
5
+ constexpr void destroy_at(T* location);
6
+ namespace ranges {
7
+ template<destructible T>
8
+ constexpr void destroy_at(T* location) noexcept;
9
+ }
10
+ ```
11
+
12
+ *Effects:*
13
+
14
+ - If `T` is an array type, equivalent to
15
+ `destroy(begin(*location), end(*location))`.
16
+ - Otherwise, equivalent to `location->T̃()`.
17
+
18
+ ``` cpp
19
+ template<class NoThrowForwardIterator>
20
+ constexpr void destroy(NoThrowForwardIterator first, NoThrowForwardIterator last);
21
  ```
22
 
23
  *Effects:* Equivalent to:
24
 
25
  ``` cpp
26
+ for (; first != last; ++first)
27
+ destroy_at(addressof(*first));
28
  ```
29
 
30
  ``` cpp
31
+ namespace ranges {
32
+ template<no-throw-input-iterator I, no-throw-sentinel<I> S>
33
+ requires destructible<iter_value_t<I>>
34
+ constexpr I destroy(I first, S last) noexcept;
35
+ template<no-throw-input-range R>
36
+ requires destructible<range_value_t<R>>
37
+ constexpr borrowed_iterator_t<R> destroy(R&& r) noexcept;
38
+ }
39
  ```
40
 
41
  *Effects:* Equivalent to:
42
 
43
  ``` cpp
44
  for (; first != last; ++first)
45
  destroy_at(addressof(*first));
46
+ return first;
47
  ```
48
 
49
  ``` cpp
50
+ template<class NoThrowForwardIterator, class Size>
51
+ constexpr NoThrowForwardIterator destroy_n(NoThrowForwardIterator first, Size n);
52
  ```
53
 
54
  *Effects:* Equivalent to:
55
 
56
  ``` cpp
57
  for (; n > 0; (void)++first, --n)
58
  destroy_at(addressof(*first));
59
  return first;
60
  ```
61
 
62
+ ``` cpp
63
+ namespace ranges {
64
+ template<no-throw-input-iterator I>
65
+ requires destructible<iter_value_t<I>>
66
+ constexpr I destroy_n(I first, iter_difference_t<I> n) noexcept;
67
+ }
68
+ ```
69
+
70
+ *Effects:* Equivalent to:
71
+
72
+ ``` cpp
73
+ return destroy(counted_iterator(first, n), default_sentinel).base();
74
+ ```
75
+