]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/pfr/test/run/non_dc_non_cop_but_mov.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / pfr / test / run / non_dc_non_cop_but_mov.cpp
CommitLineData
1e59de90 1// Copyright (c) 2018-2022 Antony Polukhin
20effc67
TL
2//
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6
7#include <boost/pfr/tuple_size.hpp>
8
9#include <type_traits>
10
11struct X {
12 X(X&&) = default;
13 X(const X&) = delete;
14
15 X& operator=(X&&) = default;
16 X& operator=(const X&) = delete;
17};
18struct S { X x0; X x1; int x2; X x3; };
19
20static_assert(!std::is_default_constructible<X>::value, "");
21static_assert(!std::is_default_constructible<S>::value, "");
22
23int main() {
24 static_assert(boost::pfr::tuple_size_v<S> == 4, "");
25
26 struct S5_0 { int x0; int x1; int x2; int x3; X x4; };
27 static_assert(boost::pfr::tuple_size_v<S5_0> == 5, "");
28
29 struct S5_1 { X x0; int x1; int x2; int x3; int x4; };
30 static_assert(boost::pfr::tuple_size_v<S5_1> == 5, "");
31
32 struct S5_2 { int x0; int x1; X x2; int x3; int x4; };
33 static_assert(boost::pfr::tuple_size_v<S5_2> == 5, "");
34
35 struct S5_3 { int x0; int x1; X x2; int x3; X x4; };
36 static_assert(boost::pfr::tuple_size_v<S5_3> == 5, "");
37
38 struct S5_4 { X x0; X x1; X x2; X x3; X x4; };
39 static_assert(boost::pfr::tuple_size_v<S5_4> == 5, "");
40
41 struct S6 { X x0; X x1; X x2; X x3; X x4; X x5;};
42 static_assert(boost::pfr::tuple_size_v<S6> == 6, "");
43}
44