]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/hana/test/pair/cnstr.default.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / pair / cnstr.default.cpp
index a2f288d2466561f36c37951e7e4101e359871b3c..640c47d844dbea74fd9c7179d23e51bb1ed5a9f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright Louis Dionne 2013-2016
+// Copyright Louis Dionne 2013-2017
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
 
@@ -6,6 +6,8 @@
 #include <boost/hana/first.hpp>
 #include <boost/hana/pair.hpp>
 #include <boost/hana/second.hpp>
+
+#include <type_traits>
 namespace hana = boost::hana;
 
 
@@ -14,6 +16,12 @@ struct NoDefault {
     explicit constexpr NoDefault(int) { }
 };
 
+struct NoDefault_nonempty {
+    NoDefault_nonempty() = delete;
+    explicit constexpr NoDefault_nonempty(int k) : i(k) { }
+    int i;
+};
+
 struct DefaultOnly {
     DefaultOnly() = default;
     DefaultOnly(DefaultOnly const&) = delete;
@@ -41,8 +49,13 @@ int main() {
     // make sure the default constructor is not instantiated when the
     // members of the pair are not default-constructible
     {
-        hana::pair<NoDefault, NoDefault> p{NoDefault{1}, NoDefault{2}};
-        (void)p;
+        using Pair1 = hana::pair<NoDefault, NoDefault>;
+        Pair1 p1{NoDefault{1}, NoDefault{2}};
+        static_assert(!std::is_default_constructible<Pair1>{}, "");
+
+        using Pair2 = hana::pair<NoDefault_nonempty, NoDefault_nonempty>;
+        Pair2 p2{NoDefault_nonempty{1}, NoDefault_nonempty{2}};
+        static_assert(!std::is_default_constructible<Pair2>{}, "");
     }
 
     // make sure it works when only the default constructor is defined