Skip to content

ST::conversion_result

Michael Hansen edited this page Jan 6, 2018 · 2 revisions

ST::conversion_result

Headers

#include <string_theory/string>

Public Functions

Name Summary
(constructor) Constructor for conversion_result
ok Return whether the conversion was successful
full_match Return whether the conversion matched the entire string

Details

The ST::conversion_result type stores the result of a conversion operation. Specifically, this is used by the ST::string numeric conversion functions, in the variants that can report their result.

Member Documentation

ST::conversion_result constructor

Signature
explicit conversion_result() noexcept

Default constructor. This will construct a result that has neither the ok nor the full_match status set.


ST::conversion_result::full_match

Signature
bool full_match() const noexcept

Returns true if the entire string was matched. This may be true if the whole string was a valid number (in which case ok() will also be true), or if the input string was empty (in which case ok() will be false).


ST::conversion_result::ok

Signature
bool ok() const noexcept

Returns true if the conversion was successful. More specifically, this is true if the conversion found one or more characters to convert from the beginning of the string.