From db1b0f3e3c9647afb144ba2c0fbd186c72e12d14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?=
This wording is relative to
+This wording is relative to
Modify
++ ++-2- Let t be an object of a type that is a specialization of function, +copyable_function,
+ormove_only_function, or function_ref, +such that the target object x of t has a type that is a specialization of function, +copyable_function,ormove_only_function, or function_ref. +Each argument of the invocation of x evaluated as part of the invocation of t +may alias an argument in the same position in the invocation of t that has the same type, +even if the corresponding parameter is not of reference type. +
Modify
++ ++template<class F> constexpr function_ref(F&&) noexcept; +++[…] +++-7- Effects: +Initializes bound-entity with addressof(f) +and thunk-ptr with the address of a function thunk such that +thunk(bound-entity, call-args...) is expression-equivalent +(
+) to +invoke_r<R>(static_cast<cv T&>(f), call-args...). + +-?- Remarks: +If remove_cvref_t<F> is a specialization of function_ref an implementation +may initialize bound-entity with bound-entity of f. +[Example: +
++void f1() noexcept; +void f2() noexcept; + +function_ref<void() noexcept> r1(&f1); +function_ref<void()> r2(r1); +r2(); // f1 is invoked +r1 = &f2; +r2(); // it is unspecified if f1 or f2 is invoked +++— end example] +
+
optional<T&> doesn't currently allow incomplete types anyway.
- -
This wording is relative to
Modify
+
+namespace std {
+ template<class T>
+ class optional<T&> {
+ public:
+ using value_type = T;
+ using iterator = implementation-defined; // present only if T is object type other than array of unknown bound; see [optional.ref.iterators]
+ public:
+ […]
+
+ // [optional.ref.iterators], iterator support
+ constexpr iteratorauto begin() const noexcept;
+ constexpr iteratorauto end() const noexcept;
+
+ […]
+ };
+}
+
+
+Modify
++ ++using iterator = implementation-defined; // present only if T is object type other than array of unknown bound ++++ ++-1- This type models `contiguous_iterator` (
+), meets the +Cpp17RandomAccessIterator requirements ( ), and meets +the requirements for constexpr iterators ( ), with value +type remove_cv_t<T>. The reference type is T& for `iterator`. + +-2- All requirements on container iterators (
+) apply to +`optional::iterator`. + +constexpr+iteratorauto begin() const noexcept; +++ +-?- Constraints: T is an object type other than array of unknown bound.
++-3- Returns: An object `i` of `iterator` type, such that
+If `has_value()` is `true`,+`i` is an iterator referring to `*val` if `has_value()` is `true`, andOtherwise,+a past-the-end iterator value otherwise. ++constexpr+iteratorauto end() const noexcept; +++-?- Constraints: T is an object type other than array of unknown bound.
+-4- Returns: `begin() + has_value()`.
+