vendredi 6 novembre 2020

Boost None conversion to string

I want to ask if a boost optional with int value has defined behaviour when it is converted to string and was not set a value for it ? I want to be sure whether it will always get the 0 value or could sometime crash. For instance:

boost::optional<uint32_t> value;
std::string s = std::to_string(value.get());

Aucun commentaire:

Enregistrer un commentaire