diff --git a/sus/option/option.h b/sus/option/option.h index 18eee6293..300c276ff 100644 --- a/sus/option/option.h +++ b/sus/option/option.h @@ -1680,6 +1680,9 @@ class Option final { return ::sus::clone(*this).as_mut(); } + /// Produces an [`Iterator`]($sus::iter::Iterator) over the single item in the + /// `Option`, or an empty iterator. The iterator will return a const + /// reference. _sus_pure constexpr OptionIter&> iter() const& noexcept; constexpr OptionIter&> iter() && noexcept @@ -1687,12 +1690,20 @@ class Option final { constexpr OptionIter&> iter() const& noexcept requires(std::is_reference_v); + /// Produces an [`Iterator`]($sus::iter::Iterator) over the single item in the + /// `Option`, or an empty iterator. If the `Option` holds a value, the + /// iterator will return a mutable reference to it. If the `Option` holds a + /// reference, it will return that reference. _sus_pure constexpr OptionIter iter_mut() & noexcept; constexpr OptionIter iter_mut() && noexcept requires(std::is_reference_v); constexpr OptionIter iter_mut() const& noexcept requires(std::is_reference_v); + /// Produces an [`Iterator`]($sus::iter::Iterator) over the single item in the + /// `Option`, or an empty iterator. If the Option holds a value, the iterator + /// will return ownership of the value. If the `Option` holds a reference, it + /// will return that reference. constexpr OptionIter into_iter() && noexcept; constexpr OptionIter into_iter() const& noexcept requires(::sus::mem::CopyOrRef);