Skip to main content

FeatStd Util

Variant explicit constructor

The Variant constructor have been changed from conversion constructor to explicit constructor. Assignment similar to the following will no longer compile:

FeatStd::Variant variant = 1;

Furthermore, the direct usage of values (e.g. Int values) as paremeters will no longer compile:

FeatStd::Optional<FeatStd::Variant> optionalVariant = FeatStd::Optional<FeatStd::Variant>(1)

Since the constructor is no longer inserted automatically by the compiler it has to be inserted manually to make

FeatStd::Variant variant = FeatStd::Variant(1);
FeatStd::Optional<FeatStd::Variant> optionalVariant = FeatStd::Optional<FeatStd::Variant>(FeatStd::Variant(1));

the code compile again:


Variant explicit constructor

The list of supported types that a FeatStd::Variant can handle has been extended. Beside the converting getter methods also TryGet methods are provided that will indicate if the, conversion was limited by the value range of the result type (e.g. a value 256 converted to a UInt8 will result in the value 255 due to the range limit of UInt8).