Basically, the function is std::stosmissing for unknown reasons, but you can easily collapse your own. Use std::stoito convert to int, check the value at the boundaries shortindicated, for example. std::numeric_limits<short>throw std::range_errorif it is not in the range, otherwise return this value. There.
Boost, boost::lexical_cast , ( , , , ).
boost::lexical_cast , , , , , , , stringstream, , , scanf.