fix recursion depth: cstring algorithm

This commit is contained in:
bolero-MURAKAMI 2013-01-13 01:16:48 +09:00
parent f26032dce8
commit b51b14efa9
25 changed files with 792 additions and 142 deletions

View file

@ -56,7 +56,7 @@ namespace sprout {
template<typename ForwardIterator1>
inline SPROUT_CONSTEXPR sprout::pair<ForwardIterator1, bool>
search_impl_check(sprout::pair<ForwardIterator1, bool> const& current, ForwardIterator1 last1, ForwardIterator1 searched) {
search_impl_fork(sprout::pair<ForwardIterator1, bool> const& current, ForwardIterator1 last1, ForwardIterator1 searched) {
typedef sprout::pair<ForwardIterator1, bool> type;
return searched == current.first || searched == last1 ? type(searched, true)
: type(sprout::next(current.first), false)
@ -72,7 +72,7 @@ namespace sprout {
{
typedef sprout::pair<ForwardIterator1, bool> type;
return current.second || current.first == last1 ? current
: n == 1 ? sprout::detail::search_impl_check(
: n == 1 ? sprout::detail::search_impl_fork(
current, last1,
sprout::detail::search_one(current.first, last1, first2, last2, pred)
)