Skip to content

Commit 92a2eb7

Browse files
committed
Update README with default ID type information
1 parent 33c3cf2 commit 92a2eb7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ const auto x = id.value();
430430
// y <-- int(100)
431431
const auto y = *id;
432432
```
433+
434+
### Default ID type
435+
If you don't care what the actual ID type is, then you can just not specify it. In this case, the ID will have a value type of whatever the default ID type is. By default, the default ID type is UUID, so in the preceding examples, we might have simply done:
436+
```c++
437+
using id_type = wite::id<Button>;
438+
```
439+
and our `Button` type would be using `wite::uuid` for its IDs. If you don't like the idea of using UUIDs as your default ID type, for some reason, then it is possible to set it the default type at compilation time with the `WITE_DEFAULT_ID_TYPE` compilation flag.
440+
433441
That's about it for typed-IDs.
434442

435443
## Typed-Index
@@ -1125,6 +1133,8 @@ In general, things that go wrong throw exceptions in Wite. However, if you don't
11251133
## Core
11261134
### WITE_DEFAULT_UUID_FMT
11271135
Sets the default format for IO of UUIDs. Set to one of 'D', 'd', 'N', 'n', 'B', 'b', 'P', 'p', 'X' or 'x'.
1136+
### WITE_DEFAULT_ID_TYPE
1137+
Sets the default type that will be used when `wite::id` types are created without specifying a type for the ID value itself.
11281138

11291139
## IO
11301140
### `WITE_USER_DEFINED_BYTE_TYPE_`

0 commit comments

Comments
 (0)