rili::TypeId Class Reference
Public Member Functions | |
TypeId (TypeId const &other)=default | |
TypeId & | operator= (TypeId const &other)=default |
bool | operator== (TypeId const &other) const |
bool | operator!= (TypeId const &other) const |
TypeId () | |
Static Public Member Functions | |
template<typename T > | |
static TypeId | create () noexcept |
Detailed Description
Normally when RTTI is used compiler will generate type information for every possible type in program - this can introduce huge binary bloat. TypeId class in oposition allow you to compare types in runtime only with marginal overhead and only for types which are really needed. This technique is well known and used in many serious projects - for example in LLVM. Most important trick is create()
method, rest is just syntactic sugar.
Constructor & Destructor Documentation
|
inline |
Member Function Documentation
template<typename T >
|
inlinestaticnoexcept |
create rili::TypeId instance for given, known in compile time type.
- Returns
- TypeId object instance for given in template Parameter type.
|
inline |
compare operator
- Parameters
-
other TypeId object
- Returns
- false if other was created for the same type, otherwise true
|
inline |
compare operator
- Parameters
-
other TypeId object
- Returns
- true if other was created for the same type, otherwise false
The documentation for this class was generated from the following file:
- rili/TypeId.hpp