2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

Update documentation about uuid alignment

This commit is contained in:
Peter Dimov
2024-06-10 19:32:36 +03:00
parent be5e44e892
commit 9915af1f1e
2 changed files with 14 additions and 0 deletions

View File

@@ -37,3 +37,4 @@
* The default constructor of `uuid` now produces a nil UUID instead of an uninitialized one.
* `u.data()`, where `u` is of type `uuid`, now returns a pointer to the first `uint8_t` of the representation (same as `u.begin()`.)
For backward compatibility, `data` is a function object with `operator()`, rather than a member function, which allows most existing uses of `data` as a public member to remain valid, if no longer encouraged.
* `uuid` now has the same alignment as `std::uint64_t`. It was previously unaligned (had alignment of 1, same as `std::uint8_t`.) To restore the 1.85 behavior, define the macro `BOOST_UUID_DISABLE_ALIGNMENT`.

View File

@@ -42,3 +42,16 @@ The `BOOST_UUID_USE_SSE*` and `BOOST_UUID_USE_AVX*` macros can be defined by use
Do not enable these extensions unless you're certain that they will always be available on any machine that will run your program.
The library performs no run time checks, so if an extension is missing, the program will likely crash.
Note that enabling more advanced extensions implies that more basic ones are also available.
== Alignment
[%autowidth]
|===
|Macro |Description
|`BOOST_UUID_DISABLE_ALIGNMENT`
|If defined, leaves `uuid` unaligned (alignment of 1, same as `std::uint8_t`). This was the behavior before release 1.86.
|===
By default, `uuid` has the same alignment as `std::uint64_t`. Define `BOOST_UUID_DISABLE_ALIGNMENT` to leave it unaligned.