Skip to content
Snippets Groups Projects
Commit 3d2977af authored by Joseph Boudreau's avatar Joseph Boudreau
Browse files

Merge branch 'FixStringUtilsOnMac' into 'main'

Fixed a compilation error on Mac.

See merge request !253
parents 47d9da9d 0a5ad147
No related branches found
No related tags found
1 merge request!253Fixed a compilation error on Mac.
Pipeline #6754721 passed with warnings
......@@ -120,9 +120,10 @@ namespace GeoStrUtils {
convertToNumber(str.substr(1), number);
return;
}
if (std::from_chars(str.data(), str.data() + str.size(), number).ec != std::errc{}) {
THROW_EXCEPTION("convertToNumber() - The string '"<<str<<"'. Contains unallowed chars");
}
std::istringstream stream(std::string(str.data(), str.data()+str.size()));
stream >> number;
if (!stream) THROW_EXCEPTION("convertToNumber() - The string '"<<str<<"'. Contains unallowed chars");
}
int atoi(std::string_view str) {
int result{std::numeric_limits<int>::max()};
......@@ -135,4 +136,4 @@ namespace GeoStrUtils {
convertToNumber(str, result);
return result;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment