Simple-Utility v2.3.1
Loading...
Searching...
No Matches
sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies > Class Template Reference

The core class, wrapping one functional object and enabling a variety of composing operators for it. More...

#include <BasicClosure.hpp>

Inheritance diagram for sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >:
[legend]
Collaboration diagram for sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >:
[legend]

Public Member Functions

template<class... Args>
requires std::constructible_from<Fn, Args...>
constexpr BasicClosure (Args &&... args) noexcept(std::is_nothrow_constructible_v< Fn, Args... >)
 Forwarding constructor, forwarding all of its arguments to its stored functional.
 
 BasicClosure (const BasicClosure &)=default
 Defaulted copy constructor.
 
BasicClosureoperator= (const BasicClosure &)=default
 Defaulted copy assign operator.
 
 BasicClosure (BasicClosure &&)=default
 Defaulted move constructor.
 
BasicClosureoperator= (BasicClosure &&)=default
 Defaulted move assign operator.
 
 ~BasicClosure ()=default
 Defaulted destructor.
 
constexpr operator const Fn & () const &noexcept
 Conversion operator, providing access to the stored functional as const lvalue-reference.
 
constexpr operator Fn & () &noexcept
 Conversion operator, providing access to the stored functional as lvalue-reference.
 
constexpr operator const Fn && () const &&noexcept
 Conversion operator, providing access to the stored functional as const rvalue-reference.
 
constexpr operator Fn && () &&noexcept
 Conversion operator, providing access to the stored functional as rvalue-reference.
 

Detailed Description

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
requires invoke_policy<InvokePolicy> && (... && operator_policy<OperatorPolicies>)
class sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >

The core class, wrapping one functional object and enabling a variety of composing operators for it.

Template Parameters
FnThe wrapped functional type.
InvokePolicyCRTP type, providing different operator () implementations.
OperatorPoliciesCRTP types, providing different composing operators.

Constructor & Destructor Documentation

◆ BasicClosure() [1/3]

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
template<class... Args>
requires std::constructible_from<Fn, Args...>
constexpr sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::BasicClosure ( Args &&...  args)
inlineexplicitconstexprnoexcept

Forwarding constructor, forwarding all of its arguments to its stored functional.

Template Parameters
ArgsConstructor argument types.
Parameters
argsConstructor arguments.

◆ BasicClosure() [2/3]

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::BasicClosure ( const BasicClosure< Fn, InvokePolicy, OperatorPolicies > &  )
default

Defaulted copy constructor.

Note
Only present if the stored functional is also copy constructible.

◆ BasicClosure() [3/3]

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::BasicClosure ( BasicClosure< Fn, InvokePolicy, OperatorPolicies > &&  )
default

Defaulted move constructor.

Note
Only present if the stored functional is also move constructible.

◆ ~BasicClosure()

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::~BasicClosure ( )
default

Defaulted destructor.

Member Function Documentation

◆ operator const Fn &()

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
constexpr sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::operator const Fn & ( ) const &
inlineexplicitconstexprnoexcept

Conversion operator, providing access to the stored functional as const lvalue-reference.

◆ operator const Fn &&()

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
constexpr sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::operator const Fn && ( ) const &&
inlineexplicitconstexprnoexcept

Conversion operator, providing access to the stored functional as const rvalue-reference.

◆ operator Fn &()

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
constexpr sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::operator Fn & ( ) &
inlineexplicitconstexprnoexcept

Conversion operator, providing access to the stored functional as lvalue-reference.

◆ operator Fn &&()

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
constexpr sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::operator Fn && ( ) &&
inlineexplicitconstexprnoexcept

Conversion operator, providing access to the stored functional as rvalue-reference.

◆ operator=() [1/2]

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
BasicClosure & sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::operator= ( BasicClosure< Fn, InvokePolicy, OperatorPolicies > &&  )
default

Defaulted move assign operator.

Note
Only present if the stored functional is also move assignable.

◆ operator=() [2/2]

template<function Fn, template< class > class InvokePolicy, template< class > class... OperatorPolicies>
BasicClosure & sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >::operator= ( const BasicClosure< Fn, InvokePolicy, OperatorPolicies > &  )
default

Defaulted copy assign operator.

Note
Only present if the stored functional is also copy assignable.

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