mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-11-14 10:39:05 +00:00
fix str_to_float SFINAE
This commit is contained in:
parent
907bced466
commit
686d1bf67a
2 changed files with 5 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/ctype/ascii.hpp>
|
||||
|
@ -238,15 +239,15 @@ namespace sprout {
|
|||
//
|
||||
// str_to_float
|
||||
//
|
||||
template<typename FloatType, typename Char>
|
||||
template<typename FloatType, typename Char, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR FloatType str_to_float(Char const* str, Char** endptr) {
|
||||
return sprout::detail::str_to_float<FloatType>(str, endptr);
|
||||
}
|
||||
template<typename FloatType, typename Char>
|
||||
template<typename FloatType, typename Char, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR FloatType str_to_float(Char const* str, std::nullptr_t endptr) {
|
||||
return sprout::detail::str_to_float<FloatType>(str);
|
||||
}
|
||||
template<typename FloatType, typename Char>
|
||||
template<typename FloatType, typename Char, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
inline SPROUT_CONSTEXPR FloatType str_to_float(Char const* str) {
|
||||
return sprout::detail::str_to_float<FloatType>(str);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/ctype/ascii.hpp>
|
||||
|
|
Loading…
Reference in a new issue