General Utility Library for C++17 25.4.1
gul17::OverloadSet< Fcts > Struct Template Reference

Detailed Description

template<typename... Fcts>
struct gul17::OverloadSet< Fcts >

A function object that works like an overload set of functions.

std::variant<int, double> v = 1.0;
auto str = std::visit(
[](char) { return "char"; },
[](int) { return "int"; }
}, v);
auto constexpr bit_set(unsigned bit) noexcept -> ReturnT
Set a bit in an integral type.
Definition bit_manip.h:121
A function object that works like an overload set of functions.
Definition OverloadSet.h:58

This variadic class template inherits from an arbitrary number of function objects (typically lambdas) and imports their definitions of operator() into an overload set for its own operator(). This is primarily helpful for use with std::visit().

A similar class was proposed in B. Stroustrup's "A Tour of C++", 3rd ed., Addison-Wesley, 2023.

Since
GUL14 version 2.9.2; dropped in GUL17 25.3.0; reintroduced in GUL17 version UNRELEASED

#include <OverloadSet.h>

Inherits gul17::Fcts.


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