|
| constexpr | IterValue () noexcept |
| |
| constexpr | IterValue (TValue value) noexcept |
| |
| constexpr | IterValue (const TValueDeref &value) noexcept(std::is_nothrow_copy_constructible_v< TValueDeref >) |
| |
| constexpr | IterValue (TValueDeref &&value) noexcept(std::is_nothrow_move_constructible_v< TValueDeref >) |
| |
| constexpr IterValue & | operator= (IterValue &&o)=default |
| |
| constexpr | IterValue (IterValue &&o) noexcept(std::is_nothrow_move_constructible_v< TValueDeref >) |
| |
| constexpr auto & | operator= (TValueDeref &&o) |
| |
| constexpr const TValueDeref & | value () const |
| | Get the contained value (if any). More...
|
| |
| constexpr TValueDeref & | value () |
| | Get the contained value (if any). More...
|
| |
| constexpr const TValueDeref & | value_or (TValueDeref &&def) const noexcept |
| | Get the contained value, or alternatively the given def if none is present. More...
|
| |
| constexpr TValueDeref & | value_or (TValueDeref &&def) noexcept |
| | Get the contained value, or alternatively the given def if none is present. More...
|
| |
| constexpr bool | has_value () const noexcept |
| | Get whether this optional IteratorValue contains a value. More...
|
| |
| constexpr void | swap (IterValue< TValue > &o) noexcept |
| | Swap the values within this and another IterValue container. More...
|
| |
| constexpr std::optional< TValueStore > | toStdOptional () noexcept |
| | Convert this IterValue to a std::optional<> on the owned (no-reference) type. More...
|
| |
| constexpr | operator std::optional< TValueStore > () noexcept |
| | Cast to std::optional<>. More...
|
| |
template<typename TOutValue , std::invocable< TValueDeref && > TMapFn>
requires (!std::is_reference_v<TValue>) |
| constexpr IterValue< TOutValue > | map (TMapFn mapFn) |
| | Map this IterValue's contained value (if any) to the requested new TOutValue type, using the given mapFn. More...
|
| |
template<typename TOutValue , std::invocable< TValue > TMapFn>
requires std::is_reference_v<TValue> |
| constexpr IterValue< TOutValue > | map (TMapFn mapFn) |
| | Map this IterValue's contained value (if any) to the requested new TOutValue type, using the given mapFn. More...
|
| |
template<typename TValue>
class CXXIter::IterValue< TValue >
Container that is used to pass elements through CXXIter's iterator pipelines.
This is essentially a std::optional<> that also transparently supports references (in comparison to the original). This is achieved by wrapping reference types in a std::reference_wrapper<> before storing them in the internal std::optional<>.
Definition at line 19 of file IterValue.h.
template<typename TValue >
template<typename TOutValue , std::invocable< TValueDeref && > TMapFn>
requires (!std::is_reference_v<TValue>)
Map this IterValue's contained value (if any) to the requested new TOutValue type, using the given mapFn.
- Template Parameters
-
| The | requested output type for the mapping operation. |
- Parameters
-
| mapFn | Mapper function that takes this IterValue's contained value (if any) to map it to an instance of TOutValue |
- Returns
- A new IterValue containing the mapped value if this instance contained a value.
Definition at line 115 of file IterValue.h.
template<typename TValue >
template<typename TOutValue , std::invocable< TValue > TMapFn>
requires std::is_reference_v<TValue>
Map this IterValue's contained value (if any) to the requested new TOutValue type, using the given mapFn.
- Template Parameters
-
| The | requested output type for the mapping operation. |
- Parameters
-
| mapFn | Mapper function that takes this IterValue's contained value (if any) to map it to an instance of TOutValue |
- Returns
- A new IterValue containing the mapped value if this instance contained a value.
Definition at line 128 of file IterValue.h.