diff --git a/include/gp/variant.hpp b/include/gp/variant.hpp index ed72de6..0d5b164 100644 --- a/include/gp/variant.hpp +++ b/include/gp/variant.hpp @@ -54,7 +54,7 @@ namespace gp{ template,T...>::value,int> = 0> fixed_variant(U&& value) - : index{r_index_of::value} + : index{r_index_of, T...>::value} { using actual = gp::remove_cvref_t; dtor = gp::function([](void* thing){ @@ -140,7 +140,7 @@ namespace gp{ { dtor((void*)buffer); } - index = r_index_of::value; + index = r_index_of, T...>::value; new(buffer) U(value); dtor = gp::function([](void* thing){((U*)thing)->~U();}, nullopt); cpytor = gp::function([](void* src, void* dest){new(dest) U(*(U*)src);}, nullopt); @@ -155,7 +155,7 @@ namespace gp{ dtor((void*)buffer); } new(buffer) U(gp::move(value)); - index = r_index_of::value; + index = r_index_of, T...>::value; dtor = gp::function([](void* thing){((U*)thing)->~U();}, nullopt); cpytor = gp::function([](void* src, void* dest){new(dest) U(*(U*)src);}, nullopt); mvtor = gp::function([](void* src, void* dest){new(dest) U(gp::move(*(U*)src));}, nullopt); @@ -175,7 +175,7 @@ namespace gp{ { if constexpr (gp_config::has_exceptions) { - if(r_index_of::value != index) + if(r_index_of, T...>::value != index) { throw bad_variant_access{}; } @@ -186,7 +186,7 @@ namespace gp{ template constexpr bool is_a() { - if(r_index_of::value == index) + if(r_index_of, T...>::value == index) { return true; }