From e9dd04b7a43f4995538e7af02b2cc152aff085fc Mon Sep 17 00:00:00 2001 From: Marius Bancila Date: Fri, 2 Nov 2018 19:45:39 +0200 Subject: [PATCH] Update P0959.md fixed string examples --- P0959.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/P0959.md b/P0959.md index e6eff3b..2638c25 100644 --- a/P0959.md +++ b/P0959.md @@ -159,7 +159,7 @@ Because the internal representation may not be a straightforward array of bytes Member functions `variant()` and `version()` allow checking the variant type of the uuid and, respectively, the version type. These are defined by two strongly typed enums called `uuid_variant` and `uuid_version`. ```cpp -uuid id("47183823-2574-4bfd-b411-99ed177d3e43"); +uuid id = uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43"); assert(id.version() == uuid_version::random_number_based); assert(id.variant() == uuid_variant::rfc); ``` @@ -183,7 +183,7 @@ assert(id1 == id2); std::set ids{ uuid{}, - uuid("47183823-2574-4bfd-b411-99ed177d3e43") + uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43") }; assert(ids.size() == 2); @@ -214,7 +214,7 @@ Both member and non-member `swap()` functions are available to perform the swapp ```cpp uuid empty; -uuid id("47183823-2574-4bfd-b411-99ed177d3e43"); +uuid id = uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43"); assert(empty.is_nil()); assert(!id.is_nil()); @@ -248,7 +248,7 @@ The order of the bytes in the input string reflects directly into the internal r Non-member functions `to_string()` and `to_wstring()` return a string with the UUID formatted to the canonical textual representation `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`, where `x` is a lower case hexadecimal digit. ```cpp -uuid id("47183823-2574-4bfd-b411-99ed177d3e43"); +uuid id = uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43"); assert(to_string(id) == "47183823-2574-4bfd-b411-99ed177d3e43"); assert(to_wstring(id) == L"47183823-2574-4bfd-b411-99ed177d3e43"); ``` @@ -261,7 +261,7 @@ Non-member `operators ==` and `operator !=` are provided in order to test the eq ```cpp uuid empty; -uuid id("47183823-2574-4bfd-b411-99ed177d3e43"); +uuid id = uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43"); assert(empty == empty); assert(id == id); @@ -275,7 +275,7 @@ A `std::hash<>` specialization for `uuid` is provided in order to enable the use ```cpp std::unordered_set ids{ uuid{}, - uuid("47183823-2574-4bfd-b411-99ed177d3e43"), + uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43"), }; assert(ids.size() == 2);