braces in array init

This commit is contained in:
mariusbancila 2017-12-18 23:34:31 +02:00 committed by GitHub
parent 2c4a090185
commit 55af771b8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,12 +52,12 @@ assert(guid.wstring() == str);
```
* Creating a UUID from an array
```
std::array<uint8_t, 16> arr{
std::array<uint8_t, 16> arr{{
0x47, 0x18, 0x38, 0x23,
0x25, 0x74,
0x4b, 0xfd,
0xb4, 0x11,
0x99, 0xed, 0x17, 0x7d, 0x3e, 0x43};
0x99, 0xed, 0x17, 0x7d, 0x3e, 0x43}};
uuid guid(arr);
assert(id.string() == "47183823-2574-4bfd-b411-99ed177d3e43");
```
@ -107,12 +107,12 @@ assert(empty.wstring() == L"00000000-0000-0000-0000-000000000000");
```
* Iterating through the UUID data
```
std::array<uint8_t, 16> arr{
std::array<uint8_t, 16> arr{{
0x47, 0x18, 0x38, 0x23,
0x25, 0x74,
0x4b, 0xfd,
0xb4, 0x11,
0x99, 0xed, 0x17, 0x7d, 0x3e, 0x43};
0x99, 0xed, 0x17, 0x7d, 0x3e, 0x43}};
uuid guid;
assert(guid.nil());