diff options
author | rtk0c <[email protected]> | 2022-06-30 21:38:53 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-30 21:38:53 -0700 |
commit | 7fe47a9d5b1727a61dc724523b530762f6d6ba19 (patch) | |
tree | e95be6e66db504ed06d00b72c579565bab873277 /core/src/Utils/Variant.hpp | |
parent | 2cf952088d375ac8b2f45b144462af0953436cff (diff) |
Restructure project
Diffstat (limited to 'core/src/Utils/Variant.hpp')
-rw-r--r-- | core/src/Utils/Variant.hpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/core/src/Utils/Variant.hpp b/core/src/Utils/Variant.hpp deleted file mode 100644 index df2f882..0000000 --- a/core/src/Utils/Variant.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include <utility> -#include <variant> - -template <class... Ts> -struct Overloaded : Ts... -{ - using Ts::operator()...; -}; -template <class... Ts> -Overloaded(Ts...) -> Overloaded<Ts...>; - -template <class... Args> -struct VariantCastProxy -{ - std::variant<Args...> v; - - template <class... ToArgs> - operator std::variant<ToArgs...>() const - { - return std::visit( - [](auto&& arg) -> std::variant<ToArgs...> { return arg; }, - v); - } -}; - -/// Use snake_case naming to align with `static_cast`, `dynamic_cast`, etc.. -template <class... Args> -auto variant_cast(std::variant<Args...> v) -> VariantCastProxy<Args...> -{ - return { std::move(v) }; -} |