diff --git a/source/mijin/types/script_value.hpp b/source/mijin/types/script_value.hpp index 96933ee..9459f8d 100644 --- a/source/mijin/types/script_value.hpp +++ b/source/mijin/types/script_value.hpp @@ -12,18 +12,10 @@ #include "../container/optional.hpp" #include "../util/traits.hpp" +#include "../util/variant.hpp" namespace mijin { -// -// public traits -// - -template -inline constexpr bool variant_contains_v = false; - -template -inline constexpr bool variant_contains_v> = mijin::is_any_type_v; // // public types diff --git a/source/mijin/util/variant.hpp b/source/mijin/util/variant.hpp new file mode 100644 index 0000000..42d6df1 --- /dev/null +++ b/source/mijin/util/variant.hpp @@ -0,0 +1,29 @@ + +#pragma once + +#if !defined(MIJIN_UTIL_VARIANT_HPP_INCLUDED) +#define MIJIN_UTIL_VARIANT_HPP_INCLUDED 1 + +namespace mijin +{ + +// +// public traits +// + +template +inline constexpr bool variant_contains_v = false; + +template +inline constexpr bool variant_contains_v> = mijin::is_any_type_v; + +// +// public types +// +template +struct Visitor : TCallable ... +{ + using TCallable::operator()...; +}; +} +#endif // !defined(MIJIN_UTIL_VARIANT_HPP_INCLUDED)