"ScL Feature"/
ScL Feature 0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
Loading...
Searching...
No Matches
scl::wrapper< Value, Executors > Class Template Reference

Composable proxy wrapper that delegates to Value through executors. More...

#include <wrapper.h>

Public Types

using executor_type
 The outermost executor instantiation — Executor<value_type>.
using value_type
 The wrapped value type.

Public Member Functions

constexpr wrapper ()
 Default construction — default-initialises the executor.
template<typename... Args>
requires ::std::constructible_from<executor_type, Args...>
constexpr wrapper (Args &&... args)
 Direct construction — forwards all arguments to the executor.
template<concepts::wrapper Other>
requires (!::std::same_as<::std::remove_cvref_t<Other>, wrapper> && ::std::constructible_from<executor_type, decltype(wrapper_constructor_resolver
<wrapper, Other &&>{other}.resolve())>)
constexpr wrapper (Other &&other)
 Converting construction from a compatible wrapper type.
constexpr wrapper (wrapper &&other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper &other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper const &&other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper const &other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper const volatile &&other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper const volatile &other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper volatile &&other)
 Copy / move construction from the same wrapper type.
constexpr wrapper (wrapper volatile &other)
 Copy / move construction from the same wrapper type.

Detailed Description

template<typename Value, template< typename > class... Executors>
class scl::wrapper< Value, Executors >

Composable proxy wrapper that delegates to Value through executors.

Each executor is a class template E such that E<Value> must satisfy concepts::executor — it must provide static access(Self&&) and execute(Self&&, Func&&) methods. Executors are composed left-to-right; adjacent duplicates in the list are collapsed. Defaults to feature::inplace::plain — a zero-overhead direct proxy — when no executor is specified.

Template Parameters
ValueThe wrapped value type.
ExecutorsZero or more executor class templates. Each E must satisfy concepts::executor<E<Value>>.
See also
scl::feature::concepts::executor
scl::feature::is_executor_v
wrapper<int> a{42}; // feature::inplace::plain (default)
wrapper<int, feature::inplace::plain> b{42}; // explicit plain
wrapper<int, feature::inplace::uninitialized> c{}; // deferred construction
Composable proxy wrapper that delegates to Value through executors.
Definition wrapper.h:72
constexpr wrapper()
Default construction — default-initialises the executor.

Constructor & Destructor Documentation

◆ wrapper() [1/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( )
constexpr

Default construction — default-initialises the executor.

Participates in overload resolution only if executor_type is default-initialisable.

◆ wrapper() [2/11]

template<typename Value, template< typename > class... Executors>
template<typename... Args>
requires ::std::constructible_from<executor_type, Args...>
scl::wrapper< Value, Executors >::wrapper ( Args &&... args)
explicitconstexpr

Direct construction — forwards all arguments to the executor.

Participates in overload resolution only if executor_type is constructible from Args.

Template Parameters
ArgsArgument types forwarded to the executor constructor.
Parameters
argsArguments forwarded to the executor constructor.

◆ wrapper() [3/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > & other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [4/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > const & other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [5/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > volatile & other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [6/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > const volatile & other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [7/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > && other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [8/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > const && other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [9/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > volatile && other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [10/11]

template<typename Value, template< typename > class... Executors>
scl::wrapper< Value, Executors >::wrapper ( wrapper< Value, Executors > const volatile && other)
constexpr

Copy / move construction from the same wrapper type.

All eight cv-ref qualifications of wrapper<Value, Executors...> are accepted. Each overload forwards other's executor through scl::forward_like so that the correct copy or move path is taken. Each overload participates in overload resolution only if executor_type is constructible from the corresponding cv-ref of executor_type (i.e. if the executor supports that operation).

Parameters
otherSource wrapper (any cv-ref qualification).

◆ wrapper() [11/11]

template<typename Value, template< typename > class... Executors>
template<concepts::wrapper Other>
requires (!::std::same_as<::std::remove_cvref_t<Other>, wrapper> && ::std::constructible_from<executor_type, decltype(wrapper_constructor_resolver
<wrapper, Other &&>{other}.resolve())>)
scl::wrapper< Value, Executors >::wrapper ( Other && other)
constexpr

Converting construction from a compatible wrapper type.

Accepts any wrapper whose executor chain can be unwrapped / re-wrapped into this wrapper's executor via wrapper_constructor_resolver. Participates in overload resolution only if Other is a wrapper type other than self_type and executor_type is constructible from the resolved value.

Template Parameters
OtherSource wrapper type (cv-ref qualifiers are deduced).
Parameters
otherSource wrapper.

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