/// \file // Range v3 library // // Copyright Eric Niebler 2013-present // // 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_UNIQUE_HPP #define RANGES_V3_VIEW_UNIQUE_HPP #include #include #include #include #include #include #include #include #include namespace ranges { /// \addtogroup group-views /// @{ namespace views { struct unique_fn { private: friend view_access; template static constexpr auto CPP_fun(bind)(unique_fn unique, C pred)( // requires(!range)) { return bind_back(unique, std::move(pred)); } public: template constexpr auto operator()(Rng && rng, C pred = {}) const -> CPP_ret(adjacent_filter_view, logical_negate>)( // requires viewable_range && forward_range && indirect_relation>) { return {all(static_cast(rng)), not_fn(pred)}; } }; /// \relates unique_fn /// \ingroup group-views RANGES_INLINE_VARIABLE(view, unique) } // namespace views /// @} } // namespace ranges #endif