Simple-Utility v2.3.1
Loading...
Searching...
No Matches
sl::nullables::Algorithm< Operation > Class Template Reference

The core algorithm helper, which executes the held operation when used as the right-hand-side of operator | expressions, when the left-hand-side is a valid nullable type. More...

#include <base.hpp>

Public Member Functions

 Algorithm (Operation operation) noexcept(std::is_nothrow_move_constructible_v< Operation >)
 

Friends

template<input_nullable Nullable>
requires std::regular_invocable<Operation, Nullable> && std::is_void_v<std::invoke_result_t<Operation, Nullable>>
constexpr auto operator| (Nullable &&input, const Algorithm &algorithm) noexcept(std::is_nothrow_invocable_v< Operation, Nullable >)
 
template<input_nullable Nullable>
requires std::regular_invocable<Operation, Nullable>
constexpr auto operator| (Nullable &&input, const Algorithm &algorithm) noexcept(std::is_nothrow_invocable_v< Operation, Nullable >)
 

Detailed Description

template<concepts::unqualified Operation>
class sl::nullables::Algorithm< Operation >

The core algorithm helper, which executes the held operation when used as the right-hand-side of operator | expressions, when the left-hand-side is a valid nullable type.

Template Parameters
OperationThe function type.

Constructor & Destructor Documentation

◆ Algorithm()

template<concepts::unqualified Operation>
sl::nullables::Algorithm< Operation >::Algorithm ( Operation  operation)
inlineexplicitnoexcept

Friends And Related Function Documentation

◆ operator| [1/2]

template<concepts::unqualified Operation>
template<input_nullable Nullable>
requires std::regular_invocable<Operation, Nullable> && std::is_void_v<std::invoke_result_t<Operation, Nullable>>
constexpr auto operator| ( Nullable &&  input,
const Algorithm< Operation > &  algorithm 
)
friend

◆ operator| [2/2]

template<concepts::unqualified Operation>
template<input_nullable Nullable>
requires std::regular_invocable<Operation, Nullable>
constexpr auto operator| ( Nullable &&  input,
const Algorithm< Operation > &  algorithm 
)
friend

The documentation for this class was generated from the following file: