Update P0959.md
from_string()
This commit is contained in:
parent
96510aaaca
commit
0c2f9b5094
4
P0959.md
4
P0959.md
@ -178,7 +178,7 @@ std::array<uuid::value_type, 16> arr{ {
|
|||||||
} };
|
} };
|
||||||
|
|
||||||
uuid id1{ std::span<uuid::value_type, 16>{arr} };
|
uuid id1{ std::span<uuid::value_type, 16>{arr} };
|
||||||
uuid id2{"47183823-2574-4bfd-b411-99ed177d3e43"};
|
uuid id2 = uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43");
|
||||||
assert(id1 == id2);
|
assert(id1 == id2);
|
||||||
|
|
||||||
std::set<std::uuid> ids{
|
std::set<std::uuid> ids{
|
||||||
@ -324,7 +324,7 @@ assert(id1.variant() == uuid_variant::rfc);
|
|||||||
```
|
```
|
||||||
Examples for genearting new UUIDs with the `uuid_name_generator` class:
|
Examples for genearting new UUIDs with the `uuid_name_generator` class:
|
||||||
```cpp
|
```cpp
|
||||||
uuid_name_generator dgen(uuid{"415ccc2b-f5cf-4ec1-b544-45132a518cc8"});
|
uuid_name_generator dgen(uuid::from_string("415ccc2b-f5cf-4ec1-b544-45132a518cc8"));
|
||||||
auto id1 = dgen("john");
|
auto id1 = dgen("john");
|
||||||
assert(!id1.is_nil());
|
assert(!id1.is_nil());
|
||||||
assert(id1.size() == 16);
|
assert(id1.size() == 16);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user