14 template <
bool Optional,
typename... Retrievers>
17 using type = std::variant<Retrievers...>;
19 template <
typename... Retrievers>
22 using type = std::variant<std::monostate, Retrievers...>;
24 template <
bool Optional,
typename... Retrievers>
28 template <
typename HolderClassT,
typename T,
bool Optional = false>
31 std::function<T(HolderClassT&)>,
32 std::function<T
const&(HolderClassT&)>,
33 T
const& (HolderClassT::*)(),
34 T const& (HolderClassT::*)() const,
35 T (HolderClassT::*)(),
36 T (HolderClassT::*)() const,
40 template <
typename HolderClassT,
typename T,
bool Optional>
47 [](std::monostate) -> std::optional<T> {
50 [&holder](std::function<T(HolderClassT&)>
const& fn) -> std::optional<T> {
53 [&holder](std::function<T
const&(HolderClassT&)>
const& fn) -> std::optional<T> {
56 [&holder](T
const& (HolderClassT::*fn)()) -> std::optional<T> {
57 return (holder.*fn)();
59 [&holder](T
const& (HolderClassT::*fn)()
const) -> std::optional<T> {
60 return (holder.*fn)();
62 [&holder](T (HolderClassT::*fn)()) -> std::optional<T> {
63 return (holder.*fn)();
65 [&holder](T (HolderClassT::*fn)()
const) -> std::optional<T> {
66 return (holder.*fn)();
68 [&holder](T HolderClassT::*mem) -> std::optional<T> {
71 [](T value) -> std::optional<T> {
78 template <
typename HolderClassT,
typename T>
85 [&holder](std::function<T(HolderClassT&)>
const& fn) -> T {
88 [&holder](std::function<T
const&(HolderClassT&)>
const& fn) -> T {
91 [&holder](T
const& (HolderClassT::*fn)()) -> T {
92 return (holder.*fn)();
94 [&holder](T
const& (HolderClassT::*fn)()
const) -> T {
95 return (holder.*fn)();
97 [&holder](T (HolderClassT::*fn)()) -> T {
98 return (holder.*fn)();
100 [&holder](T (HolderClassT::*fn)()
const) -> T {
101 return (holder.*fn)();
103 [&holder](T HolderClassT::*mem) -> T {
114 template <
typename HolderClassT,
typename T>
121 template <
typename HolderClassT,
typename T>
typename MakeVariantFromRetrievers< Optional, Retrievers... >::type MakeVariantFromRetrievers_v
Definition flexible_provider.hpp:25
Definition authorization.hpp:10
std::optional< T > unwrapFlexibleProvider(HolderClassT &holder, FlexibleProvider< HolderClassT, T, true > const &flexibleProvider)
Definition flexible_provider.hpp:116
Detail::MakeVariantFromRetrievers_v< Optional, std::function< T(HolderClassT &)>, std::function< T const &(HolderClassT &)>, T const &(HolderClassT::*)(), T const &(HolderClassT::*)() const, T(HolderClassT::*)(), T(HolderClassT::*)() const, T HolderClassT::*, T > FlexibleProvider
Definition flexible_provider.hpp:38
std::variant< std::monostate, Retrievers... > type
Definition flexible_provider.hpp:22
Definition flexible_provider.hpp:16
std::variant< Retrievers... > type
Definition flexible_provider.hpp:17
static T getValue(HolderClassT &holder, FlexibleProvider< HolderClassT, T, false > const &provider)
Definition flexible_provider.hpp:81
Definition flexible_provider.hpp:42
static std::optional< T > getValue(HolderClassT &holder, FlexibleProvider< HolderClassT, T, true > const &provider)
Definition flexible_provider.hpp:43
Definition overloaded.hpp:7