summaryrefslogtreecommitdiffstats
path: root/util/string/cast.cpp
diff options
context:
space:
mode:
authorAlexander Gololobov <[email protected]>2022-02-10 16:47:38 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:47:38 +0300
commitfccc62e9bfdce9be2fe7e0f23479da3a5512211a (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util/string/cast.cpp
parent39608cdb86363c75ce55b2b9a69841c3b71f22cf (diff)
Restoring authorship annotation for Alexander Gololobov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/string/cast.cpp')
-rw-r--r--util/string/cast.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/util/string/cast.cpp b/util/string/cast.cpp
index 8c40983c848..aa1e65a8e90 100644
--- a/util/string/cast.cpp
+++ b/util/string/cast.cpp
@@ -640,9 +640,9 @@ DEF_FLT_SPEC(long double)
#undef DEF_FLT_SPEC
-// Using StrToD for float and double because it is faster than sscanf.
+// Using StrToD for float and double because it is faster than sscanf.
// Exception-free, specialized for float types
-template <>
+template <>
bool TryFromStringImpl<double>(const char* data, size_t len, double& result) {
if (!len) {
return false;
@@ -680,19 +680,19 @@ bool TryFromStringImpl<long double>(const char* data, size_t len, long double& r
// Exception-throwing, specialized for float types
template <>
-double FromStringImpl<double>(const char* data, size_t len) {
+double FromStringImpl<double>(const char* data, size_t len) {
double d = 0.0;
if (!TryFromStringImpl(data, len, d)) {
ythrow TFromStringException() << TStringBuf("cannot parse float(") << TStringBuf(data, len) << TStringBuf(")");
- }
- return d;
-}
-
-template <>
-float FromStringImpl<float>(const char* data, size_t len) {
+ }
+ return d;
+}
+
+template <>
+float FromStringImpl<float>(const char* data, size_t len) {
return static_cast<float>(FromStringImpl<double>(data, len));
-}
-
+}
+
double StrToD(const char* b, const char* e, char** se) {
struct TCvt: public StringToDoubleConverter {
inline TCvt()