forked from jasder/antlr
* 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:
parent
78155af499
commit
1931ff7280
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue