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

@@ -21,14 +21,6 @@
#include "gfx/main.hpp"
// Convenience feature for visiting the below.
template<typename... Ts>
struct Visitor : Ts... {
using Ts::operator()...;
};
template<typename... Ts>
Visitor(Ts...) -> Visitor<Ts...>;
class File {
// Construct a `std::streambuf *` by default, since it's probably lighter than a `filebuf`.
std::variant<std::streambuf *, std::filebuf> _file;