From f9cb92e97b123ea4e1459bb844d63e3c3392bc1e Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Tue, 20 Oct 2020 16:14:32 +0200 Subject: [PATCH] fixed the same bug as before (variant missing remove_cvref) --- include/gp/variant.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; }