mirror of
https://github.com/boostorg/hana.git
synced 2026-02-21 03:02:11 +00:00
Use finer grained assertions acknowledging Constants
This commit is contained in:
@@ -4,7 +4,7 @@ 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/detail/static_assert.hpp>
|
||||
#include <boost/hana/detail/assert.hpp>
|
||||
#include <boost/hana/integral.hpp>
|
||||
#include <boost/hana/list/instance.hpp>
|
||||
#include <boost/hana/maybe.hpp>
|
||||
@@ -20,13 +20,13 @@ int main() {
|
||||
);
|
||||
};
|
||||
|
||||
BOOST_HANA_STATIC_ASSERT(
|
||||
BOOST_HANA_CONSTANT_ASSERT(
|
||||
traverse<Maybe>(half, list(int_<2>, int_<4>, int_<6>))
|
||||
==
|
||||
just(list(int_<1>, int_<2>, int_<3>))
|
||||
);
|
||||
|
||||
BOOST_HANA_STATIC_ASSERT(
|
||||
BOOST_HANA_CONSTANT_ASSERT(
|
||||
traverse<Maybe>(half, list(int_<2>, int_<3>, int_<6>))
|
||||
==
|
||||
nothing
|
||||
@@ -38,11 +38,11 @@ int main() {
|
||||
return list(x, x);
|
||||
};
|
||||
|
||||
BOOST_HANA_STATIC_ASSERT(
|
||||
BOOST_HANA_CONSTEXPR_ASSERT(
|
||||
traverse<List>(twice, just('x')) == list(just('x'), just('x'))
|
||||
);
|
||||
|
||||
BOOST_HANA_STATIC_ASSERT(
|
||||
BOOST_HANA_CONSTANT_ASSERT(
|
||||
traverse<List>(twice, nothing) == list(nothing)
|
||||
);
|
||||
//! [maybe]
|
||||
|
||||
Reference in New Issue
Block a user