Simple-Utility v2.3.1
Loading...
Searching...
No Matches
BasicClosure.hpp File Reference
#include <concepts>
#include <functional>
#include <type_traits>
#include <utility>
#include "Simple-Utility/concepts/stl_extensions.hpp"
Include dependency graph for BasicClosure.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sl::functional::BasicClosure< Fn, InvokePolicy, OperatorPolicies >
 The core class, wrapping one functional object and enabling a variety of composing operators for it. More...
 
struct  sl::functional::unwrap_functional< T >
 Primary template for non BasicClosure types. More...
 
struct  sl::functional::unwrap_functional< const BasicClosure< Fn, InvokePolicy, OperatorPolicies... > & >
 Specialization for const lvalue-references of BasicClosure class. More...
 
struct  sl::functional::unwrap_functional< BasicClosure< Fn, InvokePolicy, OperatorPolicies... > & >
 Specialization for lvalue-references of BasicClosure class. More...
 
struct  sl::functional::unwrap_functional< const BasicClosure< Fn, InvokePolicy, OperatorPolicies... > && >
 Specialization for const rvalue-references of BasicClosure class. More...
 
struct  sl::functional::unwrap_functional< BasicClosure< Fn, InvokePolicy, OperatorPolicies... > && >
 Specialization for rvalue-references of BasicClosure class. More...
 
struct  sl::functional::closure_template< BasicClosure< Fn, InvokePolicy, OperatorPolicies... > >
 Specialization, providing the closure template as member alias. More...
 

Namespaces

namespace  sl
 
namespace  sl::functional
 

Concepts

concept  sl::functional::function
 Determines whether the given type satisfies the constraints of a function type.
 
concept  sl::functional::invoke_policy
 Determines whether the given type satisfies the constraints of an invoke-policy.
 
concept  sl::functional::operator_policy
 Determines whether the given type satisfies the constraints of a operator-policy.
 

Typedefs

template<class T >
using sl::functional::unwrap_functional_t = typename unwrap_functional< T >::type
 Convenient alias for the type member alias to unwrap_functional trait.
 

Functions

template<class Fn >
constexpr unwrap_functional_t< Fn && > && sl::functional::forward_unwrapped (std::remove_reference_t< Fn > &fn) noexcept
 Unwraps the functional if stored in a closure. Otherwise forwards as-is.
 
template<template< class > class Closure, class Fn >
constexpr Closure< std::remove_cvref_t< Fn > > sl::functional::envelop (Fn &&fn) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Fn >, Fn >)
 Wraps the given functional into the given closure type.