1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix recursion depth O(logN): some algorithms

This commit is contained in:
bolero-MURAKAMI 2013-01-03 17:01:50 +09:00
parent 28697ee7a8
commit 5019f6aa96
162 changed files with 3600 additions and 1659 deletions

View file

@ -15,7 +15,7 @@
#include <sprout/weed/traits/type/is_c_str.hpp>
#include <sprout/weed/traits/type/is_string.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace weed {
@ -53,7 +53,7 @@ namespace sprout {
{
typedef typename result<Context, Iterator>::type result_type;
typedef typename attribute<Context, Iterator>::type attribute_type;
return NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) >= sprout::size(t_)
return sprout::distance(first, last) >= sprout::size(t_)
&&NS_SSCRISK_CEL_OR_SPROUT::equal(sprout::begin(t_), sprout::end(t_), first)
? result_type(true, sprout::next(first, sprout::size(t_)), attribute_type())
: result_type(false, first, typename attribute<Context, Iterator>::type())
@ -128,7 +128,7 @@ namespace sprout {
{
typedef typename result<Context, Iterator>::type result_type;
typedef typename attribute<Context, Iterator>::type attribute_type;
return NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) >= sprout::size(t_)
return sprout::distance(first, last) >= sprout::size(t_)
&&NS_SSCRISK_CEL_OR_SPROUT::equal(sprout::begin(t_), sprout::end(t_), first)
? result_type(true, sprout::next(first, sprout::size(t_)), attribute_type())
: result_type(false, first, typename attribute<Context, Iterator>::type())