Initial commit

This commit is contained in:
2026-01-24 16:10:02 -05:00
parent e053f094b3
commit cf4020fa08
10 changed files with 267 additions and 0 deletions

23
Variant.h Normal file
View File

@@ -0,0 +1,23 @@
// Helper to make it easier to use std::visit with std::variant
// For example,
// std::visit(
// overloaded{
// [](int i) { std::cout << "int: " << i << std::endl; },
// [](double d) { std::cout << "double: " << d << std::endl; },
// },
// variant
// );
#ifndef VARIANT_H
#define VARIANT_H
#include <variant> // NOLINT
template <class... Ts> struct overloaded : Ts... {
using Ts::operator()...;
};
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
#endif // VARIANT_H