File indexing completed on 2025-01-18 10:09:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef RANGES_V3_ACTION_ERASE_HPP
0015 #define RANGES_V3_ACTION_ERASE_HPP
0016
0017 #include <utility>
0018
0019 #include <range/v3/range_fwd.hpp>
0020
0021 #include <range/v3/action/insert.hpp>
0022 #include <range/v3/utility/static_const.hpp>
0023
0024 #include <range/v3/detail/prologue.hpp>
0025
0026 namespace ranges
0027 {
0028
0029 namespace adl_erase_detail
0030 {
0031 template(typename Cont, typename I, typename S)(
0032 requires lvalue_container_like<Cont> AND forward_iterator<I> AND
0033 sentinel_for<S, I>)
0034 auto erase(Cont && cont, I first, S last)
0035 -> decltype(unwrap_reference(cont).erase(first, last))
0036 {
0037 return unwrap_reference(cont).erase(first, last);
0038 }
0039
0040 struct erase_fn
0041 {
0042 template(typename Rng, typename I, typename S)(
0043 requires range<Rng> AND forward_iterator<I> AND sentinel_for<S, I>)
0044 auto operator()(Rng && rng, I first, S last) const
0045 -> decltype(erase((Rng &&) rng, first, last))
0046 {
0047 return erase(static_cast<Rng &&>(rng), first, last);
0048 }
0049 };
0050 }
0051
0052
0053
0054 RANGES_INLINE_VARIABLE(adl_erase_detail::erase_fn, erase)
0055
0056 namespace actions
0057 {
0058 using ranges::erase;
0059 }
0060
0061
0062
0063
0064
0065
0066 template<typename Rng, typename I, typename S>
0067 CPP_requires(erasable_range_,
0068 requires(Rng && rng, I first, S last)
0069 (
0070 ranges::erase((Rng &&) rng, first, last)
0071 )
0072 );
0073
0074
0075 template<typename Rng, typename I, typename S>
0076 CPP_concept erasable_range =
0077 range<Rng> && CPP_requires_ref(ranges::erasable_range_, Rng, I, S);
0078
0079
0080 }
0081
0082 #include <range/v3/detail/epilogue.hpp>
0083
0084 #endif