From bf86466be1f027e4c48fda8d907c8ba779089f62 Mon Sep 17 00:00:00 2001 From: Anton Autushka Date: Tue, 6 Feb 2018 13:00:51 +0300 Subject: [PATCH] In static_variant use int64_t as a tag type --- include/fc/static_variant.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp index 4f13f5b..4bfca85 100644 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -181,7 +181,8 @@ class static_variant { static_assert(impl::type_info::no_reference_types, "Reference types are not permitted in static_variant."); static_assert(impl::type_info::no_duplicates, "static_variant type arguments contain duplicate types."); - size_t _tag; + using tag_type = int64_t; + tag_type _tag; char storage[impl::type_info::size]; template @@ -326,14 +327,14 @@ public: } static int count() { return impl::type_info::count; } - void set_which( size_t w ) { + void set_which( tag_type w ) { FC_ASSERT( w < count() ); this->~static_variant(); _tag = w; impl::storage_ops<0, Types...>::con(_tag, storage); } - size_t which() const {return _tag;} + tag_type which() const {return _tag;} }; template