]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/hana/test/type/metafunction_class.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / hana / test / type / metafunction_class.cpp
index 5b33b00030fee606513dad10e153282efbf6c178..b0123708b10f6bae14024420794350ecb5977078 100644 (file)
@@ -5,6 +5,7 @@
 #include <boost/hana/assert.hpp>
 #include <boost/hana/concept/metafunction.hpp>
 #include <boost/hana/equal.hpp>
+#include <boost/hana/not.hpp>
 #include <boost/hana/type.hpp>
 
 #include <type_traits>
@@ -53,6 +54,16 @@ static_assert(!valid_call(hana::metafunction_class<no_type>, hana::type_c<x1>),
 static_assert(hana::Metafunction<decltype(hana::metafunction_class<f>)>::value, "");
 static_assert(hana::Metafunction<decltype(hana::metafunction_class<f>)&>::value, "");
 
+// Make sure metafunction_class is SFINAE-friendly
+struct not_a_mfc1 { template <typename ...> struct apply { }; };
+struct not_a_mfc2 { };
+BOOST_HANA_CONSTANT_CHECK(hana::not_(
+    hana::is_valid(hana::metafunction_class<not_a_mfc1>)(hana::type_c<void>)
+));
+BOOST_HANA_CONSTANT_CHECK(hana::not_(
+    hana::is_valid(hana::metafunction_class<not_a_mfc2>)(hana::type_c<void>)
+));
+
 
 // Make sure we don't read from a non-constexpr variable
 int main() {