General Utility Library for C++14
2.11
|
Backport of std::variant from C++17.
Classes | |
class | gul14::bad_variant_access |
The exception thrown if the wrong type is accessed on a gul14::variant. More... | |
class | gul14::variant< Ts > |
A "type-safe union". More... | |
struct | gul14::OverloadSet< Fct1, Fcts > |
A function object that works like an overload set of functions. More... | |
struct | gul14::OverloadSet< Fct1 > |
OverloadSet for a single function object. More... | |
Functions | |
virtual const char * | gul14::bad_variant_access::what () const noexcept override |
template<typename Visitor , typename... Variants> | |
constexpr decltype(auto) | gul14::visit (Visitor &&visitor_fct, Variants &&... variants) |
Call a visitor function with the actual objects stored in the given variants. More... | |
gul14::OverloadSet< Fct1, Fcts >::OverloadSet (Fct1 f1, Fcts... fs) | |
gul14::OverloadSet< Fct1 >::OverloadSet (Fct1 f1) | |
template<typename... Fct> | |
auto | gul14::make_overload_set (Fct... f) |
Create an OverloadSet from an arbitrary number of function objects. More... | |
auto gul14::make_overload_set | ( | Fct... | f | ) |
Create an OverloadSet from an arbitrary number of function objects.
This function creates an OverloadSet from the function objects given to it. This is particularly helpful for using multiple lambdas with visit():
|
inlineconstexpr |
Call a visitor function with the actual objects stored in the given variants.
This function works like std::visit from the C++17 standard library. It is often convenient to use it with make_overload_set():