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

Go to the source code of this file.

Classes

class  sl::functional::Composition< CompStrategy, FirstFn, SecondFn, OtherFns >
 Functional type, composing multiple other functional types via the provided strategy. More...
 
struct  sl::functional::is_composition< T >
 Primary template, yielding false type. More...
 
struct  sl::functional::is_composition< Composition< CompositionStrategy, Fns... > >
 Specialization for Composition. More...
 

Namespaces

namespace  sl
 
namespace  sl::functional
 

Concepts

concept  sl::functional::composition_strategy
 Determines whether the given type satisfies the requirements of a composition strategy.
 

Functions

template<composition_strategy CompositionStrategy, class FirstFn , class SecondFn , class... OtherFns>
requires (std::same_as<unwrap_functional_t<FirstFn>, FirstFn> && std::same_as<unwrap_functional_t<SecondFn>, SecondFn> && (... && std::same_as<unwrap_functional_t<OtherFns>, OtherFns>))
constexpr auto sl::functional::make_composition (FirstFn &&firstFn, SecondFn &&secondFn, OtherFns &&... otherFns) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< FirstFn >, FirstFn > &&std::is_nothrow_constructible_v< std::remove_cvref_t< SecondFn >, SecondFn > &&(... &&std::is_nothrow_constructible_v< std::remove_cvref_t< OtherFns >, OtherFns >))
 Base factory overload, taking fully unwrapped functional objects and forwarding those to a newly created Composition instance.
 
template<composition_strategy CompositionStrategy, class FirstFn , class SecondFn , class... OtherFns>
constexpr auto sl::functional::make_composition (FirstFn &&firstFn, SecondFn &&secondFn, OtherFns &&... otherFns) noexcept(noexcept(make_composition< CompositionStrategy >(forward_unwrapped< FirstFn >(firstFn), forward_unwrapped< SecondFn >(secondFn), forward_unwrapped< OtherFns >(otherFns)...)))
 Factory overload, unwrapping the given functionals and forwarding those to a newly created Composition instance.
 

Variables

template<class T >
constexpr bool sl::functional::is_composition_v = is_composition<T>::value
 Convenience constant, yielding the value of the is_composition trait.