* Added a specialized ctor for Any for nullptr.

There was an inconvenience that an Any created with a nullptr returned false for isNull()
* removed warning [forcing value to bool 'true' or 'false'] when calling is<>
This commit is contained in:
Floor 2016-11-18 17:24:11 +01:00
parent 78155af499
commit 1931ff7280
1 changed files with 6 additions and 1 deletions

View File

@ -74,7 +74,7 @@ struct Any
auto derived = dynamic_cast<Derived<T> *>(_ptr); auto derived = dynamic_cast<Derived<T> *>(_ptr);
return derived; return derived != nullptr;
} }
template<class U> template<class U>
@ -156,6 +156,11 @@ private:
}; };
template<> inline
Any::Any(std::nullptr_t&& ) : _ptr(nullptr) {
}
} // namespace antlrcpp } // namespace antlrcpp
#ifdef _WIN32 #ifdef _WIN32