From Jason Turner

[optional.iterators]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpri9ens9z/{from.md → to.md} +35 -0
tmp/tmpri9ens9z/{from.md → to.md} RENAMED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Iterator support <a id="optional.iterators">[[optional.iterators]]</a>
2
+
3
+ ``` cpp
4
+ using iterator = implementation-defined;
5
+ using const_iterator = implementation-defined;
6
+ ```
7
+
8
+ These types model `contiguous_iterator` [[iterator.concept.contiguous]],
9
+ meet the *Cpp17RandomAccessIterator*
10
+ requirements [[random.access.iterators]], and meet the requirements for
11
+ constexpr iterators [[iterator.requirements.general]], with value type
12
+ `remove_cv_t<T>`. The reference type is `T&` for `iterator` and
13
+ `const T&` for `const_iterator`.
14
+
15
+ All requirements on container iterators [[container.reqmts]] apply to
16
+ `optional::iterator` and `optional::const_iterator` as well.
17
+
18
+ Any operation that initializes or destroys the contained value of an
19
+ optional object invalidates all iterators into that object.
20
+
21
+ ``` cpp
22
+ constexpr iterator begin() noexcept;
23
+ constexpr const_iterator begin() const noexcept;
24
+ ```
25
+
26
+ *Returns:* If `has_value()` is `true`, an iterator referring to the
27
+ contained value. Otherwise, a past-the-end iterator value.
28
+
29
+ ``` cpp
30
+ constexpr iterator end() noexcept;
31
+ constexpr const_iterator end() const noexcept;
32
+ ```
33
+
34
+ *Returns:* `begin() + has_value()`.
35
+