fix container_traits for pointer type

fix to_string for longer string
This commit is contained in:
bolero-MURAKAMI 2012-12-21 22:35:48 +09:00
parent dd2b9511eb
commit 73cdad232b
14 changed files with 513 additions and 61 deletions

View file

@ -5,21 +5,12 @@
#include <sprout/config.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
inline SPROUT_CONSTEXPR std::size_t
strlen_impl(char const* s, std::size_t n) {
return !*s ? n :
sprout::detail::strlen_impl(s + 1, n + 1)
;
}
} // namespace detail
// 7.21.6.3 strlen ŠÖ<C5A0>
inline SPROUT_CONSTEXPR std::size_t
strlen(char const* s) {
return sprout::detail::strlen_impl(s, 0);
return !*s ? 0
: 1 + sprout::strlen(s + 1)
;
}
} // namespace sprout