mirror of
https://github.com/boostorg/uuid.git
synced 2026-01-19 04:42:16 +00:00
Align uuid as uint64_t/__uint128_t
This commit is contained in:
@@ -45,7 +45,20 @@ private:
|
||||
{
|
||||
private:
|
||||
|
||||
std::uint8_t repr_[ 16 ] = {};
|
||||
union
|
||||
{
|
||||
std::uint8_t repr_[ 16 ];
|
||||
|
||||
#if !defined(BOOST_UUID_DISABLE_ALIGNMENT)
|
||||
|
||||
std::uint64_t align_u64_;
|
||||
|
||||
# if defined(__SIZEOF_INT128__)
|
||||
__uint128_t align_u128_;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -70,7 +83,7 @@ public:
|
||||
|
||||
// data
|
||||
|
||||
data_type data;
|
||||
data_type data = {};
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#define BOOST_UUID_DISABLE_ALIGNMENT
|
||||
|
||||
#include <boost/uuid/uuid.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
Reference in New Issue
Block a user