#ifndef SPROUT_ALGORITHM_ONE_OF_EQUAL_HPP #define SPROUT_ALGORITHM_ONE_OF_EQUAL_HPP #include #include #include #include namespace sprout { namespace detail { template inline SPROUT_CONSTEXPR bool one_of_equal_impl(InputIterator found, InputIterator last, T const& value) { return found != last && sprout::none_of_equal(sprout::next(found), last, value) ; } } // namespace detail // // one_of_equal // // recursion depth: // [first, last) is RandomAccessIterator -> O(log N) // otherwise -> O(N) // template inline SPROUT_CONSTEXPR bool one_of_equal(InputIterator first, InputIterator last, T const& value) { return sprout::detail::one_of_equal_impl( sprout::find(first, last, value), last, value ); } } // namespace sprout #endif // #ifndef SPROUT_ALGORITHM_ONE_OF_EQUAL_HPP