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>
13namespace hana = boost::hana;
14using namespace hana::literals;
15
16
17auto negative = [](auto x) {
18 return x < hana::int_c<0>;
19};
20
21BOOST_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
27BOOST_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
33int main() { }
34

source code of boost/libs/hana/example/drop_while.cpp