mrdocs::makeOverload

Factory function that creates an Overload from the given callables.

Synopsis

Declared in <mrdocs/ADT/Overload.hpp>

template<class... Ts>
[[nodiscard]]
constexpr
Overload<std::decay_t<Ts>...>
makeOverload(Ts&&... xs) noexceptstd::is_nothrow_constructible_v<std::decay_t<Ts>, Ts &&> && ...;

Description

Prefer this over constructing Overload directly when you need perfect forwarding and decayed storage.

auto visitor = fn::makeOverload(
     [](int) { return 1; },
     [](double) { return 2; }
);

Return Value

An Overload whose base classes are the decayed types of the provided callables.

The return value should not be discarded.

Parameters

Name

Description

xs

The callables to combine.

Created with MrDocs