/// \file // Range v3 library // // Copyright Andrey Diduh 2019 // // Use, modification and distribution is subject to the // Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Project home: https://github.com/ericniebler/range-v3 // #ifndef RANGES_V3_VIEW_REMOVE_HPP #define RANGES_V3_VIEW_REMOVE_HPP #include #include #include #include #include #include #include #include #include #include namespace ranges { /// \addtogroup group-views /// @{ namespace views { struct remove_fn { private: friend view_access; template static constexpr auto bind(remove_fn remove, Value value) { return make_pipeable(bind_back(remove, std::move(value))); } template static constexpr auto CPP_fun(bind)(remove_fn remove, Value value, Proj proj)( // requires(!range)) { return make_pipeable( bind_back(remove, std::move(value), std::move(proj))); } template struct pred { Value value_; template auto operator()(T && other) const -> CPP_ret(bool)( // requires equality_comparable_with) { return static_cast(other) == value_; } }; public: template constexpr auto CPP_fun(operator())(Rng && rng, Value value)( const requires move_constructible && viewable_range && input_range && indirectly_comparable, Value const *, equal_to>) { return remove_if(static_cast(rng), pred{std::move(value)}); } template constexpr auto CPP_fun(operator())(Rng && rng, Value value, Proj proj)( const requires move_constructible && viewable_range && input_range && indirectly_comparable< iterator_t, Value const *, equal_to, Proj>) { return remove_if(static_cast(rng), pred{std::move(value)}, std::move(proj)); } }; /// \relates remove_fn /// \ingroup group-views RANGES_INLINE_VARIABLE(view, remove) } // namespace views /// @} } // namespace ranges #endif // RANGES_V3_VIEW_REMOVE_HPP