| 1 | // Copyright Louis Dionne 2013-2022 |
| 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/drop_while.hpp> |
| 7 | #include <boost/hana/equal.hpp> |
| 8 | #include <boost/hana/integral_constant.hpp> |
| 9 | #include <boost/hana/less.hpp> |
| 10 | #include <boost/hana/negate.hpp> |
| 11 | #include <boost/hana/range.hpp> |
| 12 | #include <boost/hana/tuple.hpp> |
| 13 | namespace hana = boost::hana; |
| 14 | using namespace hana::literals; |
| 15 | |
| 16 | |
| 17 | auto negative = [](auto x) { |
| 18 | return x < hana::int_c<0>; |
| 19 | }; |
| 20 | |
| 21 | BOOST_HANA_CONSTANT_CHECK( |
| 22 | hana::drop_while(hana::make_range(hana::int_c<-3>, hana::int_c<6>), negative) |
| 23 | == |
| 24 | hana::make_range(hana::int_c<0>, hana::int_c<6>) |
| 25 | ); |
| 26 | |
| 27 | BOOST_HANA_CONSTANT_CHECK( |
| 28 | hana::drop_while(hana::make_tuple(1_c, -2_c, 4_c, 5_c), negative) |
| 29 | == |
| 30 | hana::make_tuple(1_c, -2_c, 4_c, 5_c) |
| 31 | ); |
| 32 | |
| 33 | int main() { } |
| 34 | |