]>
Commit | Line | Data |
---|---|---|
20effc67 | 1 | // (C) Copyright Andrey Semashev 2013, 2020 |
7c673cae FG |
2 | |
3 | // Use, modification and distribution are subject to the | |
4 | // Boost Software License, Version 1.0. (See accompanying file | |
5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | // See http://www.boost.org/libs/config for more information. | |
8 | ||
9 | // MACRO: BOOST_NO_CXX11_ALIGNAS | |
10 | // TITLE: C++11 alignas keyword. | |
11 | // DESCRIPTION: The compiler does not support the C++11 alignment specification with alignas keyword. | |
12 | ||
13 | namespace boost_no_cxx11_alignas { | |
14 | ||
20effc67 TL |
15 | template< unsigned int Alignment > |
16 | struct alignment | |
17 | { | |
18 | static const unsigned int value = Alignment; | |
19 | }; | |
20 | ||
7c673cae FG |
21 | struct alignas(16) my_data1 |
22 | { | |
23 | char data[10]; | |
24 | }; | |
25 | ||
26 | struct alignas(double) my_data2 | |
27 | { | |
28 | char data[16]; | |
29 | }; | |
30 | ||
20effc67 TL |
31 | struct alignas(alignment< 16u >::value) my_data3 |
32 | { | |
33 | char data[16]; | |
34 | }; | |
35 | ||
7c673cae FG |
36 | my_data1 dummy1[2]; |
37 | my_data2 dummy2; | |
20effc67 TL |
38 | my_data3 dummy3; |
39 | alignas(16) char dummy4[10]; | |
40 | alignas(double) char dummy5[32]; | |
41 | alignas(alignment< 16u >::value) char dummy6[32]; | |
7c673cae FG |
42 | |
43 | int test() | |
44 | { | |
45 | // TODO: Test that the data is actually aligned on platforms with uintptr_t | |
46 | return 0; | |
47 | } | |
48 | ||
49 | } |