]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/concept/constant/mcd.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / concept / constant / mcd.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 "minimal.hpp"
6
7#include <boost/hana/concept/constant.hpp>
8#include <boost/hana/value.hpp>
9namespace hana = boost::hana;
10
11
12// Make sure we really satisfy Constant.
13static_assert(hana::Constant<minimal_constant<int, 0>>::value, "");
14static_assert(hana::Constant<minimal_constant<int, 1>>::value, "");
15static_assert(hana::Constant<minimal_constant<int, 2>>::value, "");
16static_assert(hana::Constant<minimal_constant<int, 3>>::value, "");
17
18// Make sure we can use hana::value<> properly.
19static_assert(hana::value<minimal_constant<int, 0>>() == 0, "");
20static_assert(hana::value<minimal_constant<int, 1>>() == 1, "");
21static_assert(hana::value<minimal_constant<int, 2>>() == 2, "");
22static_assert(hana::value<minimal_constant<int, 3>>() == 3, "");
23
24// Check the equivalence between `value(...)` and `value<decltype(...)>()`.
25static_assert(hana::value(minimal_constant<int, 0>{}) == hana::value<minimal_constant<int, 0>>(), "");
26static_assert(hana::value(minimal_constant<int, 1>{}) == hana::value<minimal_constant<int, 1>>(), "");
27static_assert(hana::value(minimal_constant<int, 2>{}) == hana::value<minimal_constant<int, 2>>(), "");
28static_assert(hana::value(minimal_constant<int, 3>{}) == hana::value<minimal_constant<int, 3>>(), "");
29
30
31int main() { }