Simple-Utility v2.3.1
Loading...
Searching...
No Matches
sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns > Class Template Reference

Functional type, composing multiple other functional types via the provided strategy. More...

#include <Composition.hpp>

Public Types

using CompositionStrategy = CompStrategy
 

Public Member Functions

template<class FirstCTorArg , class SecondCTorArg , class... OtherCTorArgs>
requires std::constructible_from<FirstFn, FirstCTorArg> && std::constructible_from<SecondFn, SecondCTorArg> && (... && std::constructible_from<OtherFns, OtherCTorArgs>)
constexpr Composition (FirstCTorArg &&firstArg, SecondCTorArg &&secondArg, OtherCTorArgs &&... otherArgs) noexcept(std::is_nothrow_constructible_v< FirstFn, FirstCTorArg > &&std::is_nothrow_constructible_v< SecondFn, SecondCTorArg > &&(... &&std::is_nothrow_constructible_v< OtherFns, OtherCTorArgs >))
 Constructor forwarding the given args to the related functional member.
 
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<const FirstFn&, const SecondFn&, const OtherFns&...>, Args...>
constexpr decltype(auto) operator() (Args &&... args) const &noexcept(std::is_nothrow_invocable_v< CompStrategy, std::tuple< const FirstFn &, const SecondFn &, const OtherFns &... >, Args... >)
 Call operator, providing the member functionals and given arguments to the composition strategy.
 
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<FirstFn&, SecondFn&, OtherFns&...>, Args...>
constexpr decltype(auto) operator() (Args &&... args) &noexcept(std::is_nothrow_invocable_v< CompStrategy, std::tuple< FirstFn &, SecondFn &, OtherFns &... >, Args... >)
 Call operator, providing the member functionals and given arguments to the composition strategy.
 
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<const FirstFn&&, const SecondFn&&, const OtherFns&&...>, Args...>
constexpr decltype(auto) operator() (Args &&... args) const &&noexcept(std::is_nothrow_invocable_v< CompStrategy, std::tuple< const FirstFn &&, const SecondFn &&, const OtherFns &&... >, Args... >)
 Call operator, providing the member functionals and given arguments to the composition strategy.
 
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<FirstFn&&, SecondFn&&, OtherFns&&...>, Args...>
constexpr decltype(auto) operator() (Args &&... args) &&noexcept(std::is_nothrow_invocable_v< CompStrategy, std::tuple< FirstFn &&, SecondFn &&, OtherFns &&... >, Args... >)
 Call operator, providing the member functionals and given arguments to the composition strategy.
 
constexpr std::tuple< const FirstFn &, const SecondFn &, const OtherFns &... > fns () const &noexcept
 Getter to the member functions.
 
constexpr std::tuple< FirstFn &, SecondFn &, OtherFns &... > fns () &noexcept
 Getter to the member functions.
 
constexpr std::tuple< const FirstFn &&, const SecondFn &&, const OtherFns &&... > fns () const &&noexcept
 Getter to the member functions.
 
constexpr std::tuple< FirstFn &&, SecondFn &&, OtherFns &&... > fns () &&noexcept
 Getter to the member functions.
 

Detailed Description

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
class sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >

Functional type, composing multiple other functional types via the provided strategy.

Template Parameters
CompStrategyThe provided strategy type.
FirstFnThe first functional type.
SecondFnThe second functional type.
OtherFnsOther functional types.

Member Typedef Documentation

◆ CompositionStrategy

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
using sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::CompositionStrategy = CompStrategy

Constructor & Destructor Documentation

◆ Composition()

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
template<class FirstCTorArg , class SecondCTorArg , class... OtherCTorArgs>
requires std::constructible_from<FirstFn, FirstCTorArg> && std::constructible_from<SecondFn, SecondCTorArg> && (... && std::constructible_from<OtherFns, OtherCTorArgs>)
constexpr sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::Composition ( FirstCTorArg &&  firstArg,
SecondCTorArg &&  secondArg,
OtherCTorArgs &&...  otherArgs 
)
inlineconstexprnoexcept

Constructor forwarding the given args to the related functional member.

Template Parameters
FirstCTorArgThe constructor argument type of the first functional.
SecondCTorArgThe constructor argument type of the second functional.
OtherCTorArgsThe constructor argument types of other functionals.
Parameters
firstArgThe constructor argument of the first functional.
secondArgThe constructor argument of the second functional.
otherArgsThe constructor argument of other functionals.
Exceptions
Doesnot throw, if all functional constructors are noexcept.

Member Function Documentation

◆ fns() [1/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
constexpr std::tuple< FirstFn &&, SecondFn &&, OtherFns &&... > sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::fns ( ) &&
inlineconstexprnoexcept

Getter to the member functions.

Returns
Returns all member functions as rvalue-reference, tied into newly created tuple.
Here is the call graph for this function:

◆ fns() [2/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
constexpr std::tuple< FirstFn &, SecondFn &, OtherFns &... > sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::fns ( ) &
inlineconstexprnoexcept

Getter to the member functions.

Returns
Returns all member functions as lvalue-reference, tied into newly created tuple.
Here is the call graph for this function:

◆ fns() [3/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
constexpr std::tuple< const FirstFn &&, const SecondFn &&, const OtherFns &&... > sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::fns ( ) const &&
inlineconstexprnoexcept

Getter to the member functions.

Returns
Returns all member functions as const rvalue-reference, tied into newly created tuple.
Here is the call graph for this function:

◆ fns() [4/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
constexpr std::tuple< const FirstFn &, const SecondFn &, const OtherFns &... > sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::fns ( ) const &
inlineconstexprnoexcept

Getter to the member functions.

Returns
Returns all member functions as const lvalue-reference, tied into newly created tuple.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()() [1/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<FirstFn&&, SecondFn&&, OtherFns&&...>, Args...>
constexpr decltype(auto) sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::operator() ( Args &&...  args) &&
inlineconstexprnoexcept

Call operator, providing the member functionals and given arguments to the composition strategy.

Template Parameters
ArgsGiven argument types.
Parameters
argsGiven arguments.
Returns
Forwards the result of the composition strategy call.

◆ operator()() [2/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<FirstFn&, SecondFn&, OtherFns&...>, Args...>
constexpr decltype(auto) sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::operator() ( Args &&...  args) &
inlineconstexprnoexcept

Call operator, providing the member functionals and given arguments to the composition strategy.

Template Parameters
ArgsGiven argument types.
Parameters
argsGiven arguments.
Returns
Forwards the result of the composition strategy call.
Here is the call graph for this function:

◆ operator()() [3/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<const FirstFn&&, const SecondFn&&, const OtherFns&&...>, Args...>
constexpr decltype(auto) sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::operator() ( Args &&...  args) const &&
inlineconstexprnoexcept

Call operator, providing the member functionals and given arguments to the composition strategy.

Template Parameters
ArgsGiven argument types.
Parameters
argsGiven arguments.
Returns
Forwards the result of the composition strategy call.

◆ operator()() [4/4]

template<composition_strategy CompStrategy, function FirstFn, function SecondFn, function... OtherFns>
template<class... Args>
requires std::invocable<CompStrategy, std::tuple<const FirstFn&, const SecondFn&, const OtherFns&...>, Args...>
constexpr decltype(auto) sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >::operator() ( Args &&...  args) const &
inlineconstexprnoexcept

Call operator, providing the member functionals and given arguments to the composition strategy.

Template Parameters
ArgsGiven argument types.
Parameters
argsGiven arguments.
Returns
Forwards the result of the composition strategy call.
Here is the call graph for this function:

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