14 std::variant<std::monostate, int, std::string> var = 10;
19 [](
const std::string&) {
REQUIRE(
false); }},
24 var, [](std::monostate) {
REQUIRE(
false); }, [](int) {
REQUIRE(
true); },
25 [](
const std::string&) {
REQUIRE(
false); });
30 [](
const std::string&) {
REQUIRE(
false); });
36 std::variant<std::monostate, int, std::string> var = 10;
41 [](
const std::string&) {
REQUIRE(
false); }},
46 var, [](std::monostate) {
REQUIRE(
false); }, [](int) {
REQUIRE(
true); },
47 [](
const std::string&) {
REQUIRE(
false); });
51 std::variant<std::monostate, int, std::string> var(std::in_place_type<int>,
56 std::is_same_v<
decltype(val),
57 std::variant_alternative_t<constant,
decltype(var)>>);
62 std::variant<int, std::string> from(std::in_place_type<int>, 10);
64 = kblib::variant_cast<std::variant<std::monostate, int, std::string>>(
Provides generic facilities for hashing data, and aliases for standard unordered containers using the...
constexpr auto visit_indexed(Variant &&variant, Fs &&... fs) -> decltype(auto)
Visit a variant, but pass the index (as an integral_constant) to the visitor. This allows for a visit...
constexpr auto visit2(V &&v, F &&f, Fs &&... fs) -> decltype(auto)
constexpr auto visit(V &&v, F &&f, Fs &&... fs) -> decltype(auto)
Wraps std::visit to provide an interface taking one variant and any number of functors providing an o...
Helper class for std::visiting a std::variant.
Provides utilities for working with std::variant more expressively and more efficiently.