31 Jan
2024
31 Jan
'24
3:31 p.m.
On Wed, Jan 31, 2024 at 1:38 PM Peter Dimov via Boost
Viktor Sehr wrote:
I think boost::charconv should add one convenience function as follows: // Returns std::nullopt on error template <typename NumberType> std::optional<NumberType> boost::charconv::to_number(const std::string_view& sv) noexcept;
This throws away the error code
But sometimes that's all you want. That's kinda the point from Viktor I guess. Not that an `expected` or `outcome` return type is bad; but it is more complex.
[...] to avoid a dependency on
and therefore <string>
Hopefully one day with modules and `import std;` this will be a thing of the past... But that's I guess another completely different can of worms! --DD