static_variant::set_which() rejects negative param

This commit is contained in:
Abit 2018-01-20 16:54:09 +01:00 committed by GitHub
parent 7cd9f1c7a4
commit dffe2a444e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -327,6 +327,7 @@ public:
static int count() { return impl::type_info<Types...>::count; }
void set_which( int w ) {
FC_ASSERT( w >= 0 );
FC_ASSERT( w < count() );
this->~static_variant();
_tag = w;