template<InputIterator I, Sentinel<I> S, WeaklyIncrementable O, IndirectUnaryPredicate<I> Pred> requires IndirectlyMovable<I, O> void move_if(I first, S last, O out, Pred pred) { std::ranges::copy_if(move_iterator<I>{first}, move_sentinel<S>{last}, out, pred); }— end example
namespace std { template<Semiregular S> class move_sentinel { public: constexpr move_sentinel(); constexpr explicit move_sentinel(S s); template<class S2> requires ConvertibleTo<const S2&, S> constexpr move_sentinel(const move_sentinel<S2>& s); template<class S2> requires Assignable<S&, const S2&> constexpr move_sentinel& operator=(const move_sentinel<S2>& s); constexpr S base() const; private: S last; // exposition only }; }