C++: Compile fix for MSVC

Change-Id: Ie6399ae95b1dee84dc85fe2e7634c020b312a9a7
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
This commit is contained in:
Nikolai Kosjar
2015-01-14 11:33:12 +01:00
committed by Nikolai Kosjar
parent 70c9c51e5e
commit 8f988a0a21

View File

@@ -483,7 +483,7 @@ bool stringLiteralToInt(const StringLiteral *stringLiteral, int *output)
}
std::stringstream ss(std::string(stringLiteral->chars(), stringLiteral->size()));
const bool ok = ss >> *output;
const bool ok = !(ss >> *output).fail();
if (!ok)
*output = 0;