Horizon
Loading...
Searching...
No Matches
3rd_party
range-v3
range
v3
action
drop_while.hpp
Go to the documentation of this file.
1
2
// Range v3 library
3
//
4
// Copyright Eric Niebler 2013-present
5
//
6
// Use, modification and distribution is subject to the
7
// Boost Software License, Version 1.0. (See accompanying
8
// file LICENSE_1_0.txt or copy at
9
// http://www.boost.org/LICENSE_1_0.txt)
10
//
11
// Project home: https://github.com/ericniebler/range-v3
12
//
13
14
#ifndef RANGES_V3_ACTION_DROP_WHILE_HPP
15
#define RANGES_V3_ACTION_DROP_WHILE_HPP
16
17
#include <
range/v3/range_fwd.hpp
>
18
19
#include <
range/v3/action/action.hpp
>
20
#include <
range/v3/action/erase.hpp
>
21
#include <
range/v3/algorithm/find_if_not.hpp
>
22
#include <
range/v3/functional/bind_back.hpp
>
23
#include <
range/v3/iterator/concepts.hpp
>
24
#include <
range/v3/iterator/traits.hpp
>
25
#include <range/v3/utility/static_const.hpp>
26
27
#include <range/v3/detail/prologue.hpp>
28
29
namespace
ranges
30
{
33
namespace
actions
34
{
35
struct
drop_while_fn
36
{
37
template
(
typename
Fun)(
38
requires
(!
range<Fun>
))
39
constexpr
auto
operator
()(Fun fun)
const
40
{
41
return
make_action_closure(bind_back(
drop_while_fn
{}, std::move(fun)));
42
}
43
44
template
(
typename
Rng,
typename
Fun)(
45
requires
forward_range<Rng>
AND
46
indirect_unary_predicate
<Fun,
iterator_t<Rng>
> AND
47
erasable_range
<Rng &,
iterator_t<Rng>
,
iterator_t<Rng>
>)
48
Rng operator()(Rng && rng, Fun fun)
const
49
{
50
ranges::actions::erase(
51
rng, begin(rng), find_if_not(begin(rng), end(rng), std::move(fun)));
52
return
static_cast<
Rng &&
>
(rng);
53
}
54
};
55
57
RANGES_INLINE_VARIABLE(
drop_while_fn
, drop_while)
58
}
// namespace actions
60
}
// namespace ranges
61
62
#include <range/v3/detail/epilogue.hpp>
63
64
#endif
action.hpp
bind_back.hpp
ranges::erasable_range
The erasable_range concept.
ranges::forward_range
The forward_range concept.
ranges::indirect_unary_predicate
The indirect_unary_predicate concept.
ranges::range
The range concept.
erase.hpp
find_if_not.hpp
ranges::iterator_t
decltype(begin(declval(Rng &))) iterator_t
Definition
access.hpp:698
traits.hpp
concepts.hpp
range_fwd.hpp
ranges::actions::drop_while_fn
Definition
drop_while.hpp:36
Generated by
1.9.8