#include "narrow.h"#include <charconv>#include <optional>#include <string>#include <string_view>#include <type_traits>Go to the source code of this file.
Definition at line 23 of file string2int.cpp.
Definition at line 16 of file string2int.cpp.
Convert a string to an integer, given the base of the representation, works with signed and unsigned integer types, rejects negative inputs when the result type is unsigned, rejects the empty string, rejects leading spaces, rejects any trailing non-numerical suffix.
A prefix such as 0, 0x, 0X to change base is not supported.
Definition at line 66 of file string2int.h.
Convert string to integer as per stoi, but return nullopt when stoi would throw.
Definition at line 59 of file string2int.cpp.
Convert string to size_t similar to the stoul or stoull functions, return nullopt when the conversion fails.
Note: Unlike stoul or stoull negative inputs are disallowed
Definition at line 70 of file string2int.cpp.
Convert string to unsigned similar to the stoul or stoull functions, return nullopt when the conversion fails.
Note: Unlike stoul or stoull negative inputs are disallowed
Definition at line 64 of file string2int.cpp.
Definition at line 30 of file string2int.cpp.
Definition at line 45 of file string2int.cpp.
Definition at line 40 of file string2int.cpp.
Definition at line 35 of file string2int.cpp.