File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
include/beman/optional26/detail Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,18 +43,20 @@ struct contiguous_iterator : public base_contiguous_iterator<T, Container> {
43
43
using typename base_type::reference;
44
44
45
45
// Default constructor.
46
- contiguous_iterator () noexcept : m_current() {}
46
+ constexpr contiguous_iterator () noexcept : m_current() {}
47
47
48
48
// Pointer to iterator constructor.
49
- contiguous_iterator (pointer it) noexcept : m_current(it) {}
49
+ constexpr contiguous_iterator (pointer it) noexcept : m_current(it) {}
50
50
51
51
// As per P2727R4, for contiguous iterator we only need to provide operator*, operator+= and operator-.
52
- reference operator *() const noexcept { return *m_current; }
53
- auto & operator +=(difference_type pos) noexcept {
52
+ constexpr reference operator *() const noexcept { return *m_current; }
53
+ constexpr auto & operator +=(difference_type pos) noexcept {
54
54
m_current += pos;
55
55
return *this ;
56
56
}
57
- difference_type operator -(contiguous_iterator other) const noexcept { return m_current - other.m_current ; }
57
+ constexpr difference_type operator -(contiguous_iterator other) const noexcept {
58
+ return m_current - other.m_current ;
59
+ }
58
60
59
61
private:
60
62
T* m_current;
You can’t perform that action at this time.
0 commit comments