-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2024 Peter Dimov | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// https://www.boost.org/LICENSE_1_0.txt | ||
|
||
#include <boost/uuid/uuid.hpp> | ||
#include <boost/core/lightweight_test.hpp> | ||
#include <cstddef> | ||
|
||
using namespace boost::uuids; | ||
|
||
struct X1 | ||
{ | ||
unsigned char a; | ||
uuid b; | ||
}; | ||
|
||
struct X2 | ||
{ | ||
unsigned char a[2]; | ||
uuid b; | ||
}; | ||
|
||
int main() | ||
{ | ||
BOOST_TEST_EQ( offsetof(X1, b), 1 ); | ||
BOOST_TEST_EQ( offsetof(X2, b), 2 ); | ||
|
||
return boost::report_errors(); | ||
} |