]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/pfr/test/run/non_dc_non_cop_but_mov.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / pfr / test / run / non_dc_non_cop_but_mov.cpp
diff --git a/ceph/src/boost/libs/pfr/test/run/non_dc_non_cop_but_mov.cpp b/ceph/src/boost/libs/pfr/test/run/non_dc_non_cop_but_mov.cpp
new file mode 100644 (file)
index 0000000..4aaa973
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright (c) 2018-2020 Antony Polukhin
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+
+#include <boost/pfr/tuple_size.hpp>
+
+#include <type_traits>
+
+struct X {
+    X(X&&) = default;
+    X(const X&) = delete;
+
+    X& operator=(X&&) = default;
+    X& operator=(const X&) = delete;
+};
+struct S { X x0; X x1; int x2; X x3; };
+
+static_assert(!std::is_default_constructible<X>::value, "");
+static_assert(!std::is_default_constructible<S>::value, "");
+
+int main() {
+    static_assert(boost::pfr::tuple_size_v<S> == 4, "");
+
+    struct S5_0 { int x0; int x1; int x2; int x3; X x4; };
+    static_assert(boost::pfr::tuple_size_v<S5_0> == 5, "");
+
+    struct S5_1 { X x0; int x1; int x2; int x3; int x4; };
+    static_assert(boost::pfr::tuple_size_v<S5_1> == 5, "");
+
+    struct S5_2 { int x0; int x1; X x2; int x3; int x4; };
+    static_assert(boost::pfr::tuple_size_v<S5_2> == 5, "");
+
+    struct S5_3 { int x0; int x1; X x2; int x3; X x4; };
+    static_assert(boost::pfr::tuple_size_v<S5_3> == 5, "");
+
+    struct S5_4 { X x0; X x1; X x2; X x3; X x4; };
+    static_assert(boost::pfr::tuple_size_v<S5_4> == 5, "");
+
+    struct S6 { X x0; X x1; X x2; X x3; X x4;  X x5;};
+    static_assert(boost::pfr::tuple_size_v<S6> == 6, "");
+}
+