Updates from BitShares FC #22
1 changed files with 4 additions and 3 deletions
|
|
@ -181,7 +181,8 @@ class static_variant {
|
||||||
static_assert(impl::type_info<Types...>::no_reference_types, "Reference types are not permitted in static_variant.");
|
static_assert(impl::type_info<Types...>::no_reference_types, "Reference types are not permitted in static_variant.");
|
||||||
static_assert(impl::type_info<Types...>::no_duplicates, "static_variant type arguments contain duplicate types.");
|
static_assert(impl::type_info<Types...>::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<Types...>::size];
|
char storage[impl::type_info<Types...>::size];
|
||||||
|
|
||||||
template<typename X>
|
template<typename X>
|
||||||
|
|
@ -326,14 +327,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int count() { return impl::type_info<Types...>::count; }
|
static int count() { return impl::type_info<Types...>::count; }
|
||||||
void set_which( size_t w ) {
|
void set_which( tag_type w ) {
|
||||||
FC_ASSERT( w < count() );
|
FC_ASSERT( w < count() );
|
||||||
this->~static_variant();
|
this->~static_variant();
|
||||||
_tag = w;
|
_tag = w;
|
||||||
impl::storage_ops<0, Types...>::con(_tag, storage);
|
impl::storage_ops<0, Types...>::con(_tag, storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t which() const {return _tag;}
|
tag_type which() const {return _tag;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Result>
|
template<typename Result>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue