diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp index a8e2c62..8fbc100 100644 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -80,7 +80,7 @@ struct storage_ops { } static void con(int n, void *data) { if(n == N) new(reinterpret_cast(data)) T(); - else storage_ops::del(n, data); + else storage_ops::con(n, data); } template @@ -316,7 +316,8 @@ public: void set_which( int w ) { this->~static_variant(); - impl::storage_ops<0, Types...>::con(_tag, storage); + _tag = w; + impl::storage_ops<0, Types...>::con(_tag, storage); } int which() const {return _tag;}