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

Update documentation

This commit is contained in:
Peter Dimov
2026-01-09 16:15:39 +02:00
parent 11b392d9ff
commit 0af8de5509
3 changed files with 37 additions and 2 deletions

View File

@@ -11,6 +11,7 @@
* Most `uuid` accessors, operations, and `to_chars` are now `constexpr` when possible (on {cpp}14 and higher and on recent compilers).
* Added SIMD implementation of `to_chars`, which can offer up to 5.5x performance improvement in UUID formatting. (Andrey Semashev)
* Added SIMD implementation of `from_chars`, which can offer up to 13x performance improvement in UUID parsing. (Andrey Semashev)
* Added `uuid_from_string` to `boost/uuid/uuid_io.hpp`.
== Changes in Boost 1.90.0

View File

@@ -25,7 +25,7 @@ struct string_generator
template<class CharIterator>
constexpr uuid operator()( CharIterator first, CharIterator last,
int& pos, from_chars_error& err ) const noexcept;
std::ptrdiff_t& pos, from_chars_error& err ) const noexcept;
};
}} // namespace boost::uuids
@@ -120,7 +120,7 @@ uuid u2 = gen( s2.begin(), s2.end() );
```
template<class CharIterator>
constexpr uuid operator()( CharIterator first, CharIterator last,
int& pos, from_chars_error& err ) const noexcept;
std::ptrdiff_t& pos, from_chars_error& err ) const noexcept;
```
Requires: :: `CharIterator` must be an input iterator with a character value type (one of `char`, `wchar_t`, `char8_t`, `char16_t`, `char32_t`).

View File

@@ -63,6 +63,11 @@ template<class Ch>
constexpr from_chars_result<Ch>
from_chars( Ch const* first, Ch const* last, uuid& u ) noexcept;
// uuid_from_string
template<class Ch> constexpr uuid uuid_from_string( Ch const* str );
template<class Str> constexpr uuid uuid_from_string( Str const& str );
}} // namespace boost::uuids
----
@@ -269,3 +274,32 @@ Effects: ::
NOTE: The values `from_chars_error::closing_brace_expected` and `from_chars_error::unexpected_extra_input` are never returned by `from_chars`.
They can be returned from the nonthrowing `string_generator::operator()` overload.
=== uuid_from_string
```
template<class Ch> constexpr uuid uuid_from_string( Ch const* str );
```
Requires: :: `Ch` must be a character type (one of `char`, `wchar_t`, `char8_t`, `char16_t`, `char32_t`).
Effects: ::
Parses a `uuid` string representation from the characters in the range `[str, str + std::char_traits<Ch>::length(str))` and stores the result in `u`.
On error, throws `std::runtime_error`.
NOTE: Unlike `from_chars`, this function does not allow extra input; if after a complete UUID is parsed, unconsumed characters remain, an exception is thrown.
```
template<class Str> constexpr uuid uuid_from_string( Str const& str );
```
Requires: ::
`Str` must be a _string-like_ type; that is, one with a nested `value_type` type (`Ch`) and with a nested `traits_type` type.
`str.data()` must return `Ch const*`. `str.size()` must return `std::size_t`.
`Ch` must be a character type (one of `char`, `wchar_t`, `char8_t`, `char16_t`, `char32_t`).
Effects: ::
Parses a `uuid` string representation from the characters in the range `[str.data(), str.data() + str.size())` and stores the result in `u`.
On error, throws `std::runtime_error`.
NOTE: Unlike `from_chars`, this function does not allow extra input; if after a complete UUID is parsed, unconsumed characters remain, an exception is thrown.