mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
Merge pull request #58 from minamiyama1994/minamiyama1994-develop
cannot compile this code ( http://melpon.org/wandbox/permlink/dMPGXatLnT...
This commit is contained in:
commit
ae9578ce37
2 changed files with 16 additions and 0 deletions
|
@ -241,9 +241,17 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR FloatType
|
||||
str_to_float(CStrIterator str, CharPtr* endptr) {
|
||||
return !endptr ? sprout::detail::str_to_float<FloatType>(str)
|
||||
#ifdef __MINGW32__
|
||||
: std::is_same<typename std::remove_cv<FloatType>::type, float>::value ? strtof(&*str, endptr)
|
||||
#else
|
||||
: std::is_same<typename std::remove_cv<FloatType>::type, float>::value ? std::strtof(&*str, endptr)
|
||||
#endif
|
||||
: std::is_same<typename std::remove_cv<FloatType>::type, double>::value ? std::strtod(&*str, endptr)
|
||||
#ifdef __MINGW32__
|
||||
: strtold(&*str, endptr)
|
||||
#else
|
||||
: std::strtold(&*str, endptr)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
|
|
|
@ -109,10 +109,18 @@ namespace sprout {
|
|||
return !endptr ? sprout::detail::str_to_int<IntType>(str, base)
|
||||
: std::is_signed<IntType>::value
|
||||
? sizeof(IntType) <= sizeof(long) ? static_cast<IntType>(std::strtol(&*str, endptr, base))
|
||||
#ifdef __MINGW32__
|
||||
: sizeof(IntType) <= sizeof(long long) ? static_cast<IntType>(strtoll(&*str, endptr, base))
|
||||
#else
|
||||
: sizeof(IntType) <= sizeof(long long) ? static_cast<IntType>(std::strtoll(&*str, endptr, base))
|
||||
#endif
|
||||
: static_cast<IntType>(std::strtoimax(&*str, endptr, base))
|
||||
: sizeof(IntType) <= sizeof(unsigned long) ? static_cast<IntType>(std::strtoul(&*str, endptr, base))
|
||||
#ifdef __MINGW32__
|
||||
: sizeof(IntType) <= sizeof(unsigned long long) ? static_cast<IntType>(strtoull(&*str, endptr, base))
|
||||
#else
|
||||
: sizeof(IntType) <= sizeof(unsigned long long) ? static_cast<IntType>(std::strtoull(&*str, endptr, base))
|
||||
#endif
|
||||
: static_cast<IntType>(std::strtoumax(&*str, endptr, base))
|
||||
;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue