Use std::visit with Visitor helper instead of std::holds_alternatve

This commit is contained in:
Rangi42
2024-02-29 13:32:50 -05:00
committed by Sylvie
parent cf08fed067
commit 1210a7441f
3 changed files with 13 additions and 12 deletions

View File

@@ -85,4 +85,12 @@
// For lack of <ranges>, this adds some more brevity
#define RANGE(s) std::begin(s), std::end(s)
// Convenience feature for visiting variants.
template<typename... Ts>
struct Visitor : Ts... {
using Ts::operator()...;
};
template<typename... Ts>
Visitor(Ts...) -> Visitor<Ts...>;
#endif // HELPERS_H