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

@ -10,6 +10,7 @@
#include <sprout/algorithm/find_if.hpp>
#include <sprout/algorithm/tristate_lexicographical_compare.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/cstring/strlen.hpp>
namespace sprout {
//
@ -62,9 +63,7 @@ namespace sprout {
);
}
static SPROUT_CONSTEXPR std::size_t length(char_type const* s) {
return !*s ? 0
: 1 + length(s + 1)
;
return sprout::detail::strlen(s);
}
static SPROUT_CONSTEXPR char_type const* find(char_type const* s, std::size_t n, char_type const& a) {
return find_impl(
@ -128,9 +127,7 @@ namespace sprout {
}
template<typename ConstIterator>
static SPROUT_CONSTEXPR std::size_t length(ConstIterator s) {
return !*s ? 0
: 1 + length(s + 1)
;
return sprout::detail::strlen(s);
}
template<typename ConstIterator>
static SPROUT_CONSTEXPR ConstIterator find(ConstIterator s, std::size_t n, char_type const& a) {