From Jason Turner

[common.iter.access]

Diff to HTML by rtfpessoa

tmp/tmpeba3z2es/{from.md → to.md} RENAMED
@@ -1,32 +1,32 @@
1
  #### Accessors <a id="common.iter.access">[[common.iter.access]]</a>
2
 
3
  ``` cpp
4
- decltype(auto) operator*();
5
- decltype(auto) operator*() const
6
  requires dereferenceable<const I>;
7
  ```
8
 
9
- *Preconditions:* `holds_alternative<I>(v_)`.
10
 
11
  *Effects:* Equivalent to: `return *get<I>(v_);`
12
 
13
  ``` cpp
14
- decltype(auto) operator->() const
15
  requires see below;
16
  ```
17
 
18
- The expression in the requires clause is equivalent to:
19
 
20
  ``` cpp
21
  indirectly_readable<const I> &&
22
  (requires(const I& i) { i.operator->(); } ||
23
  is_reference_v<iter_reference_t<I>> ||
24
  constructible_from<iter_value_t<I>, iter_reference_t<I>>)
25
  ```
26
 
27
- *Preconditions:* `holds_alternative<I>(v_)`.
28
 
29
  *Effects:*
30
 
31
  - If `I` is a pointer type or if the expression
32
  `get<I>(v_).operator->()` is well-formed, equivalent to:
@@ -40,14 +40,14 @@ indirectly_readable<const I> &&
40
  - Otherwise, equivalent to: `return `*`proxy`*`(*get<I>(v_));` where
41
  *proxy* is the exposition-only class:
42
  ``` cpp
43
  class proxy {
44
  iter_value_t<I> keep_;
45
- proxy(iter_reference_t<I>&& x)
46
  : keep_(std::move(x)) {}
47
  public:
48
- const iter_value_t<I>* operator->() const {
49
  return addressof(keep_);
50
  }
51
  };
52
  ```
53
 
 
1
  #### Accessors <a id="common.iter.access">[[common.iter.access]]</a>
2
 
3
  ``` cpp
4
+ constexpr decltype(auto) operator*();
5
+ constexpr decltype(auto) operator*() const
6
  requires dereferenceable<const I>;
7
  ```
8
 
9
+ *Preconditions:* `holds_alternative<I>(v_)` is `true`.
10
 
11
  *Effects:* Equivalent to: `return *get<I>(v_);`
12
 
13
  ``` cpp
14
+ constexpr auto operator->() const
15
  requires see below;
16
  ```
17
 
18
+ The expression in the *requires-clause* is equivalent to:
19
 
20
  ``` cpp
21
  indirectly_readable<const I> &&
22
  (requires(const I& i) { i.operator->(); } ||
23
  is_reference_v<iter_reference_t<I>> ||
24
  constructible_from<iter_value_t<I>, iter_reference_t<I>>)
25
  ```
26
 
27
+ *Preconditions:* `holds_alternative<I>(v_)` is `true`.
28
 
29
  *Effects:*
30
 
31
  - If `I` is a pointer type or if the expression
32
  `get<I>(v_).operator->()` is well-formed, equivalent to:
 
40
  - Otherwise, equivalent to: `return `*`proxy`*`(*get<I>(v_));` where
41
  *proxy* is the exposition-only class:
42
  ``` cpp
43
  class proxy {
44
  iter_value_t<I> keep_;
45
+ constexpr proxy(iter_reference_t<I>&& x)
46
  : keep_(std::move(x)) {}
47
  public:
48
+ constexpr const iter_value_t<I>* operator->() const noexcept {
49
  return addressof(keep_);
50
  }
51
  };
52
  ```
53