"ScL Feature"/
SCL Feature 0.0.1
C++20 composable proxy wrapper with pluggable executor strategy
Loading...
Searching...
No Matches
wrapper.h
1#pragma once
2
3#include <scl/feature/detail/wrapper_constructor_resolver.h>
4#include <scl/feature/detail/wrapper_constructors.h>
5
6#include <utility>
7
8namespace scl::feature::detail
9{
10 // NOLINTBEGIN(cppcoreguidelines-special-member-functions)
11 template <typename Value, template <typename> class Executor>
12 class wrapper
13 {
14 using self_type = wrapper<Value, Executor>;
15
16 public:
17 using value_type = Value;
18 using executor_type = Executor<value_type>;
19
20 private:
21 executor_type m_executor;
22
23 friend struct executor_access;
24
25 public:
27 template <typename... Args>
28 constexpr explicit wrapper(Args &&... args)
29 : m_executor{::std::forward<Args>(args)...}
30 {}
31
32 // clang-format off
33 // cppcheck-suppress noExplicitConstructor
34 SCL_WRAPPER_CONSTRUCTOR_FOR_SELF // NOLINT(performance-noexcept-move-constructor)
35 // cppcheck-suppress noExplicitConstructor
36 SCL_WRAPPER_CONSTRUCTOR_FOR_OTHER
37 // clang-format on
38 };
39 // NOLINTEND(cppcoreguidelines-special-member-functions)
40} // namespace scl::feature::detail
::std::conditional_t< sizeof...(Executors)==0, typename ::scl::feature::detail::wrapper_fold< Value, ::scl::feature::inplace::plain >::type, typename ::scl::feature::detail::wrapper_fold< Value, Executors... >::type > wrapper
Composable proxy wrapper that delegates to Value through executors.
Definition wrapper.h:67