2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

Merge pull request #185 from Lastique/feature/from_chars_result_op_bool

Add `from_chars_result::operator bool()`
This commit is contained in:
Peter Dimov
2025-12-29 13:08:27 +02:00
committed by GitHub
4 changed files with 18 additions and 0 deletions

View File

@@ -55,6 +55,8 @@ template<class Ch> struct from_chars_result
{
Ch const* ptr;
from_chars_error ec;
constexpr explicit operator bool() const noexcept;
};
template<class Ch>
@@ -239,6 +241,17 @@ std::string s1 = to_string( u );
std::wstring s2 = to_wstring( u );
```
=== from_chars_result
The `from_chars_result` structure contains the result of a `from_chars` call, where the `ptr` member points to the first character that was
not consumed during parsing and `ec` is `from_chars_error::none`, if parsing succeeded, otherwise the error code returned by the parser.
```
constexpr explicit operator bool() const noexcept;
```
Returns: :: `this->ec == from_chars_error::none`.
=== from_chars
```