]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/pair/empty_storage.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / pair / empty_storage.cpp
CommitLineData
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
8namespace hana = boost::hana;
9
10
11// Make sure the storage of a pair is compressed
12struct empty { };
13static_assert(sizeof(hana::pair<empty, int>) == sizeof(int), "");
14static_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.
19struct empty1 { };
20struct empty2 { };
21static_assert(std::is_empty<hana::pair<empty1, empty2>>{}, "");
22
7c673cae 23int main() { }