From 1931ff72804583d744ea2055f8058990f8a7323a Mon Sep 17 00:00:00 2001 From: Floor Date: Fri, 18 Nov 2016 17:24:11 +0100 Subject: [PATCH] * 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<> --- runtime/Cpp/runtime/src/support/Any.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/Cpp/runtime/src/support/Any.h b/runtime/Cpp/runtime/src/support/Any.h index 9a845383e..b82575463 100644 --- a/runtime/Cpp/runtime/src/support/Any.h +++ b/runtime/Cpp/runtime/src/support/Any.h @@ -74,7 +74,7 @@ struct Any auto derived = dynamic_cast *>(_ptr); - return derived; + return derived != nullptr; } template @@ -156,6 +156,11 @@ private: }; + template<> inline + Any::Any(std::nullptr_t&& ) : _ptr(nullptr) { + } + + } // namespace antlrcpp #ifdef _WIN32