mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix recursion depth: cstring algorithm
This commit is contained in:
parent
f26032dce8
commit
b51b14efa9
25 changed files with 792 additions and 142 deletions
|
@ -89,9 +89,7 @@ namespace sprout {
|
|||
)
|
||||
{
|
||||
typedef sprout::tuples::tuple<ForwardIterator1, ForwardIterator2, bool> type;
|
||||
return sprout::tuples::get<0>(
|
||||
sprout::detail::search_one_impl(type(first1, first2, false), last1, last2, pred, first1, 1)
|
||||
);
|
||||
return sprout::tuples::get<0>(sprout::detail::search_one_impl(type(first1, first2, false), last1, last2, pred, first1, 1));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
26
sprout/detail/str.hpp
Normal file
26
sprout/detail/str.hpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef SPROUT_DETAIL_STR_HPP
|
||||
#define SPROUT_DETAIL_STR_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace detail {
|
||||
template<typename InputIterator>
|
||||
inline SPROUT_CONSTEXPR InputIterator
|
||||
str_find_check(InputIterator found) {
|
||||
return !*found ? InputIterator()
|
||||
: found
|
||||
;
|
||||
}
|
||||
|
||||
template<typename InputIterator, typename T>
|
||||
inline SPROUT_CONSTEXPR InputIterator
|
||||
str_find_check(InputIterator found, T const& value) {
|
||||
return !(*found == value) && !*found ? InputIterator()
|
||||
: found
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_DETAIL_STR_HPP
|
Loading…
Add table
Add a link
Reference in a new issue