Work around MSVS 2012 bug with handling of nullptr

Avoid error C2180 given by this compiler for if statements with
controlling expression of type nullptr_t.
This commit is contained in:
Vadim Zeitlin
2020-02-02 01:12:28 +01:00
parent 0073b54f8e
commit 6724f8c052

View File

@@ -858,7 +858,8 @@ template<> struct wxStrtoxCharType<std::nullptr_t>
template<typename T>
inline double wxStrtod(const wxString& nptr, T endptr)
{
if (endptr)
// Explicit comparison with 0 required when using T=nullptr with MSVS 2012.
if (endptr != 0)
{
// note that it is important to use c_str() here and not mb_str() or
// wc_str(), because we store the pointer into (possibly converted)