|
|
@ -54,7 +54,7 @@ namespace gp{ |
|
|
|
|
|
|
|
template<typename U, std::enable_if_t<list_contains_class<gp::remove_cvref_t<U>,T...>::value,int> = 0> |
|
|
|
fixed_variant(U&& value) |
|
|
|
: index{r_index_of<U, T...>::value} |
|
|
|
: index{r_index_of<gp::remove_cvref_t<U>, T...>::value} |
|
|
|
{ |
|
|
|
using actual = gp::remove_cvref_t<U>; |
|
|
|
dtor = gp::function<void(void*)>([](void* thing){ |
|
|
@ -140,7 +140,7 @@ namespace gp{ |
|
|
|
{ |
|
|
|
dtor((void*)buffer); |
|
|
|
} |
|
|
|
index = r_index_of<U, T...>::value; |
|
|
|
index = r_index_of<gp::remove_cvref_t<U>, T...>::value; |
|
|
|
new(buffer) U(value); |
|
|
|
dtor = gp::function([](void* thing){((U*)thing)->~U();}, nullopt); |
|
|
|
cpytor = gp::function<void(void*, void*)>([](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<U, T...>::value; |
|
|
|
index = r_index_of<gp::remove_cvref_t<U>, T...>::value; |
|
|
|
dtor = gp::function([](void* thing){((U*)thing)->~U();}, nullopt); |
|
|
|
cpytor = gp::function<void(void*, void*)>([](void* src, void* dest){new(dest) U(*(U*)src);}, nullopt); |
|
|
|
mvtor = gp::function<void(void*, void*)>([](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<U, T...>::value != index) |
|
|
|
if(r_index_of<gp::remove_cvref_t<U>, T...>::value != index) |
|
|
|
{ |
|
|
|
throw bad_variant_access<U>{}; |
|
|
|
} |
|
|
@ -186,7 +186,7 @@ namespace gp{ |
|
|
|
template<typename U> |
|
|
|
constexpr bool is_a() |
|
|
|
{ |
|
|
|
if(r_index_of<U, T...>::value == index) |
|
|
|
if(r_index_of<gp::remove_cvref_t<U>, T...>::value == index) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|