]>
Commit | Line | Data |
---|---|---|
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 | #include <boost/hana/equal.hpp> | |
7 | #include <boost/hana/ext/std/integral_constant.hpp> | |
8 | #include <boost/hana/functional/compose.hpp> | |
9 | #include <boost/hana/optional.hpp> | |
10 | #include <boost/hana/remove_if.hpp> | |
11 | #include <boost/hana/tuple.hpp> | |
12 | #include <boost/hana/type.hpp> | |
13 | ||
14 | #include <type_traits> | |
15 | namespace hana = boost::hana; | |
16 | ||
17 | ||
18 | // First get the type of the object, and then call the trait on it. | |
19 | constexpr auto is_integral = hana::compose(hana::trait<std::is_integral>, hana::typeid_); | |
20 | ||
21 | static_assert(hana::remove_if(hana::make_tuple(1, 2.0, 3, 4.0), is_integral) == hana::make_tuple(2.0, 4.0), ""); | |
22 | static_assert(hana::remove_if(hana::just(3.0), is_integral) == hana::just(3.0), ""); | |
23 | BOOST_HANA_CONSTANT_CHECK(hana::remove_if(hana::just(3), is_integral) == hana::nothing); | |
24 | ||
25 | int main() { } |