From 0f7cfd46ef2d277f5f82e34a2852c75212d75261 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 12 Dec 2018 20:34:46 +0000 Subject: Fix conversion issues by replacing ConvToInt with ConvToNum. The former was a thin wrapper around atol and brought with it all of the weird parsing logic of atol which is almost never what is actually wanted. It also almost never returned the numeric type which is actually wanted which can cause weird issues when casting. --- include/convto.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'include') diff --git a/include/convto.h b/include/convto.h index c306283fc..3332580ed 100644 --- a/include/convto.h +++ b/include/convto.h @@ -89,17 +89,8 @@ template inline std::string ConvToStr(const T& in) return tmp.str(); } -/** Template function to convert any input type to any other type - * (usually an integer or numeric type) +/** Template function to convert a std::string to any numeric type. */ -template inline long ConvToInt(const T& in) -{ - std::stringstream tmp; - if (!(tmp << in)) - return 0; - return atol(tmp.str().c_str()); -} - template inline TOut ConvToNum(const std::string& in) { TOut ret; -- cgit v1.3.1-10-gc9f91