separated size and nil

This commit is contained in:
Marius Bancila 2018-01-23 11:23:10 +02:00 committed by GitHub
parent 03ec86bbb5
commit c55a99c3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,16 +70,20 @@ uuid::value_type arr[16] = {
uuid id(arr); uuid id(arr);
``` ```
### Capacity ### Size
Member function `size()` indicates the number of bytes in the UUID. Because this is a fixed size structure this function always returns 16. Member function `size()` indicates the number of bytes in the UUID. Because this is a fixed size structure this function always returns 16.
```
uuid id;
assert(id.size() == 16);
```
Member function `nil()` indicates whether the `uuid` has all the bits set to 0. A nil uuid is created by the default constructor or by the string conversion constructors when failing to parse the input argument. ### Nil
A nil UUID is a special UUID that has all the bits set to 0. Its canonical textaul representation is `00000000-0000-0000-0000-000000000000`. Member function `nil()` indicates whether the `uuid` has all the bits set to 0. A nil uuid is created by the default constructor or by the string conversion constructors when failing to parse the input argument.
``` ```
uuid id; uuid id;
assert(id.nil()); assert(id.nil());
assert(id.size() == 16);
``` ```
### Iterators ### Iterators