mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Use std::visit with Visitor helper instead of std::holds_alternatve
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user