fix coding-stype

This commit is contained in:
bolero-MURAKAMI 2012-10-06 00:58:56 +09:00
parent 2012838899
commit df3023db30
196 changed files with 2510 additions and 3945 deletions

View file

@ -14,7 +14,8 @@ namespace sprout {
// Copyright (c) 2011 osyo-manga : http://d.hatena.ne.jp/osyo-manga/
template<typename IntType, typename CStrIterator>
inline SPROUT_CONSTEXPR IntType ascii_to_int_impl(CStrIterator str, IntType val, bool negative) {
inline SPROUT_CONSTEXPR IntType
ascii_to_int_impl(CStrIterator str, IntType val, bool negative) {
return !sprout::ascii::isdigit(*str)
? negative ? -val : val
: val > (std::numeric_limits<IntType>::max() - (*str - static_cast<typename std::iterator_traits<CStrIterator>::value_type>('0')) - (negative ? 1 : 0)) / 10
@ -27,7 +28,8 @@ namespace sprout {
;
}
template<typename IntType, typename CStrIterator, typename sprout::enabler_if<std::is_unsigned<IntType>::value>::type = sprout::enabler>
inline SPROUT_CONSTEXPR IntType ascii_to_int(CStrIterator str) {
inline SPROUT_CONSTEXPR IntType
ascii_to_int(CStrIterator str) {
return sprout::ascii::isspace(*str)
? sprout::detail::ascii_to_int<IntType>(sprout::next(str))
: *str == static_cast<typename std::iterator_traits<CStrIterator>::value_type>('+')
@ -36,7 +38,8 @@ namespace sprout {
;
}
template<typename IntType, typename CStrIterator, typename sprout::enabler_if<std::is_signed<IntType>::value>::type = sprout::enabler>
inline SPROUT_CONSTEXPR IntType ascii_to_int(CStrIterator str) {
inline SPROUT_CONSTEXPR IntType
ascii_to_int(CStrIterator str) {
return sprout::ascii::isspace(*str)
? sprout::detail::ascii_to_int<IntType>(sprout::next(str))
: *str == static_cast<typename std::iterator_traits<CStrIterator>::value_type>('-')
@ -52,7 +55,8 @@ namespace sprout {
// ascii_to_int
//
template<typename IntType, typename Char, typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler>
inline SPROUT_CONSTEXPR IntType ascii_to_int(Char const* str) {
inline SPROUT_CONSTEXPR IntType
ascii_to_int(Char const* str) {
return sprout::detail::ascii_to_int<IntType>(str);
}
} // namespace sprout