![]() |
ATLAS Offline Software
|
Find the class ID of a type, without triggering an error if it isn't defined. More...
Go to the source code of this file.
Namespaces | |
SG | |
Forward declaration. | |
Functions | |
template<class T > | |
constexpr CLID | SG::safe_clid () |
Return the class ID of T, or CLID_NULL if it doesn't have one. More... | |
Find the class ID of a type, without triggering an error if it isn't defined.
This header provides SG::safe_clid<T>(), which should return the class ID of T, or CLID_NULL if T does not have a defined class ID (without causing an error).
The implementation relies on the fact that when the class ID traits class gets specialized for a specific class ID, it defines has_classID_tag. The CLASS_DEF macro makes this definition, but if you specialize ClassID_traits yourself, you must remember to include has_classID_tag, or this function won't work.
Definition in file safe_clid.h.