diff options
author | CNugteren <web@cedricnugteren.nl> | 2016-01-30 14:57:49 +0100 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2016-01-30 14:57:49 +0100 |
commit | 9622d3be22d062765a39e664725e9aad42f62014 (patch) | |
tree | 1ddd497871f0f838a4e07d590e028225d70acedc /src/utilities.cc | |
parent | 44fb40e5c464a532d683352b73123c77d1a5a9f7 (diff) |
Fixes for compilation under Visual Studio
Diffstat (limited to 'src/utilities.cc')
-rw-r--r-- | src/utilities.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/utilities.cc b/src/utilities.cc index 042b3116..24efb14c 100644 --- a/src/utilities.cc +++ b/src/utilities.cc @@ -103,7 +103,13 @@ std::string ToString(Precision value) { // both the real and imaginary parts. template <typename T> T ConvertArgument(const char* value) { - return static_cast<T>(std::stod(value)); + return static_cast<T>(std::stoi(value)); +} +template <> float ConvertArgument(const char* value) { + return static_cast<float>(std::stod(value)); +} +template <> double ConvertArgument(const char* value) { + return static_cast<double>(std::stod(value)); } template <> float2 ConvertArgument(const char* value) { auto val = static_cast<float>(std::stod(value)); @@ -139,7 +145,6 @@ T GetArgument(const int argc, char *argv[], std::string &help, } // Compiles the above function -template bool GetArgument<bool>(const int, char **, std::string&, const std::string&, const bool); template int GetArgument<int>(const int, char **, std::string&, const std::string&, const int); template size_t GetArgument<size_t>(const int, char **, std::string&, const std::string&, const size_t); template float GetArgument<float>(const int, char **, std::string&, const std::string&, const float); |