mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
add cwchar.hpp
rename decimal_to_int -> ascii_to_int
This commit is contained in:
parent
50fd5f33bf
commit
28f7c510a5
34 changed files with 576 additions and 92 deletions
|
@ -56,7 +56,16 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename IntType, typename CStrIterator>
|
||||
template<typename IntType, typename CStrIterator, typename sprout::enabler_if<std::is_unsigned<IntType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR IntType str_to_int(CStrIterator str, int base) {
|
||||
return sprout::ascii::isspace(*str)
|
||||
? sprout::detail::str_to_int<IntType>(sprout::next(str), base)
|
||||
: *str == static_cast<typename std::iterator_traits<CStrIterator>::value_type>('+')
|
||||
? sprout::detail::str_to_int_impl<IntType>(sprout::next(str), base, false)
|
||||
: sprout::detail::str_to_int_impl<IntType>(str, base, false)
|
||||
;
|
||||
}
|
||||
template<typename IntType, typename CStrIterator, typename sprout::enabler_if<std::is_signed<IntType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR IntType str_to_int(CStrIterator str, int base) {
|
||||
return sprout::ascii::isspace(*str)
|
||||
? sprout::detail::str_to_int<IntType>(sprout::next(str), base)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue