////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2025-2026. Distributed under 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) // // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_CONTAINER_EXPERIMENTAL_SEGMENTED_REMOVE_HPP #define BOOST_CONTAINER_EXPERIMENTAL_SEGMENTED_REMOVE_HPP #ifndef BOOST_CONFIG_HPP # include #endif #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include #include #include namespace boost { namespace container { //! Removes all elements equal to \c value from [first, last), //! moving retained elements forward. Returns iterator to new end. template FwdIt segmented_remove(FwdIt first, Sent last, const T& value) { typedef segmented_iterator_traits traits; first = detail_algo::segmented_find_dispatch (first, last, value , typename traits::is_segmented_iterator() , typename iterator_traits::iterator_category()); if(first == last) return last; FwdIt next = first; ++next; return detail_algo::segmented_remove_copy_dispatch (next, last, first, value, typename traits::is_segmented_iterator(), typename iterator_traits::iterator_category()); } } // namespace container } // namespace boost #include #endif // BOOST_CONTAINER_EXPERIMENTAL_SEGMENTED_REMOVE_HPP