]>
Commit | Line | Data |
---|---|---|
b32b8144 | 1 | // Copyright Louis Dionne 2013-2017 |
7c673cae FG |
2 | // Distributed under the Boost Software License, Version 1.0. |
3 | // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | |
4 | ||
5 | #include <boost/hana/pair.hpp> | |
b32b8144 FG |
6 | |
7 | #include <type_traits> | |
7c673cae FG |
8 | namespace hana = boost::hana; |
9 | ||
10 | ||
11 | // Make sure the storage of a pair is compressed | |
12 | struct empty { }; | |
13 | static_assert(sizeof(hana::pair<empty, int>) == sizeof(int), ""); | |
14 | static_assert(sizeof(hana::pair<int, empty>) == sizeof(int), ""); | |
15 | ||
b32b8144 FG |
16 | // Also make sure that a pair with only empty members is empty too. This is |
17 | // important to ensure, for example, that a tuple of pairs of empty objects | |
18 | // will get the EBO. | |
19 | struct empty1 { }; | |
20 | struct empty2 { }; | |
21 | static_assert(std::is_empty<hana::pair<empty1, empty2>>{}, ""); | |
22 | ||
7c673cae | 23 | int main() { } |