]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/maximum.cpp
1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/greater.hpp>
8 #include <boost/hana/integral_constant.hpp>
9 #include <boost/hana/maximum.hpp>
10 #include <boost/hana/tuple.hpp>
11 namespace hana
= boost::hana
;
15 // without a predicate
16 BOOST_HANA_CONSTANT_CHECK(
17 hana::maximum(hana::tuple_c
<int, -1, 0, 2, -4, 6, 9>) == hana::int_c
<9>
21 auto smallest
= hana::maximum(hana::tuple_c
<int, -1, 0, 2, -4, 6, 9>, [](auto x
, auto y
) {
22 return x
> y
; // order is reversed!
24 BOOST_HANA_CONSTANT_CHECK(smallest
== hana::int_c
<-4>);