# FeatStd Util

<span style="color: rgb(34, 34, 34); font-size: 1.666em; font-weight: 400;">Variant explicit constructor</span>

The [Variant](http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_variant.html) constructor have been changed from conversion constructor to explicit constructor. Assignment similar to the following will no longer compile:

```
<a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_variant.html">FeatStd::Variant</a> variant = 1;
```

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

```
<a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_optional.html">FeatStd::Optional<FeatStd::Variant></a> optionalVariant = <a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_optional.html">FeatStd::Optional<FeatStd::Variant></a>(1)
```

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

```
<a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_variant.html">FeatStd::Variant</a> variant = <a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_variant.html">FeatStd::Variant</a>(1);
<a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_optional.html">FeatStd::Optional<FeatStd::Variant></a> optionalVariant = <a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_optional.html">FeatStd::Optional<FeatStd::Variant></a>(<a class="code" href="http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_variant.html">FeatStd::Variant</a>(1));
```

the code compile again:

<div class="contents" id="bkmrk-"><div class="contents"><div class="textblock">---

</div></div></div>#### Variant explicit constructor

The list of supported types that a [FeatStd::Variant](http://dev.doc.cgistudio.at/APILINK/class_feat_std_1_1_variant.html) 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).

---