diff --git a/source/mijin/util/variant.hpp b/source/mijin/util/variant.hpp index a3a98d5..b30de87 100644 --- a/source/mijin/util/variant.hpp +++ b/source/mijin/util/variant.hpp @@ -4,6 +4,7 @@ #if !defined(MIJIN_UTIL_VARIANT_HPP_INCLUDED) #define MIJIN_UTIL_VARIANT_HPP_INCLUDED 1 +#include #include #include "./traits.hpp" @@ -23,10 +24,21 @@ inline constexpr bool variant_contains_v // // public types // + template struct Visitor : TCallable ... { using TCallable::operator()...; }; + +template +struct CastTo +{ + template + TRet operator()(T&& arg) const + { + return static_cast(std::forward(arg)); + } +}; } #endif // !defined(MIJIN_UTIL_VARIANT_HPP_INCLUDED)