]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/hana/example/struct/searchable.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / example / struct / searchable.cpp
index ce25f182b89a0f638c07afefb025362eabfc00c7..aae5dbfa0ed3b811a23868d5713bb9add9ea6af9 100644 (file)
@@ -1,12 +1,15 @@
-// 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)
 
+#include <boost/hana/accessors.hpp>
+#include <boost/hana/all_of.hpp>
 #include <boost/hana/assert.hpp>
 #include <boost/hana/define_struct.hpp>
 #include <boost/hana/equal.hpp>
 #include <boost/hana/find.hpp>
 #include <boost/hana/optional.hpp>
+#include <boost/hana/second.hpp>
 #include <boost/hana/string.hpp>
 
 #include <string>
@@ -30,4 +33,14 @@ int main() {
     BOOST_HANA_CONSTANT_CHECK(
         hana::find(john, BOOST_HANA_STRING("foobar")) == hana::nothing
     );
+
+
+    BOOST_HANA_RUNTIME_CHECK(
+        hana::all_of(hana::accessors<Person>(), [&](auto a) {
+            return hana::second(a)(john) == hana::second(a)(john);
+        })
+    );
+
+    // the above is equivalent to:
+    BOOST_HANA_RUNTIME_CHECK(hana::equal(john, john));
 }