]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/assert/lambdas.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / assert / lambdas.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
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)
4
5#include <boost/hana/assert.hpp>
6
7#include <support/cnumeric.hpp>
8namespace hana = boost::hana;
9
10
11// This test makes sure that we can use lambdas inside the various
12// BOOST_HANA_XXX_ASSERT macros.
13
14template <bool value>
15bool runtime_bool() { return value; }
16
17template <bool value>
18auto constant_bool() { return make_cnumeric<bool, value>(); }
19
20int main() {
21 BOOST_HANA_CONSTANT_ASSERT([]{ return constant_bool<true>(); }());
22 BOOST_HANA_RUNTIME_ASSERT([]{ return runtime_bool<true>(); }());
23 BOOST_HANA_ASSERT([] { return constant_bool<true>(); }());
24 BOOST_HANA_ASSERT([] { return runtime_bool<true>(); }());
25}