Questions tagged [rtti]

Run-Time Type Information: A C++ mechanism that exposes information about an object's data type at runtime.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Verified downcasting if RTTI is active

In an application that uses heavily polymorphic classes, I have often the need to downcast a pointer or a reference to the correct derived class. They should always be of the correct derived class, ...
Aganju's user avatar
  • 189
4 votes
1 answer

Is there a better solution to get RTTI info about a polymorphic type?

I made some code to get RTTI information of a polymorphic object, it works both if you pass it directly or a pointer to it(the pointer will get dereferenced until null or the object is found), it's ...
Mirko Angel's user avatar
1 vote
2 answers

Map a set of types to unique IDs and runtime reinterpret back from ID and pointer in C++17

I wanted to create a relatively universal way of serialising an object, by doing a memcpy and generating a unique type ID. Stored together they can be used, for ...
Stefan's user avatar
  • 813
2 votes
1 answer

Drill through and down the object properties with RTTI

I am in process of making debugging output better for client-side application. We have lots of auto-generated Protocol Buffers classes which are used for communication by our protocol. I am trying to ...
rsrx's user avatar
  • 121
20 votes
2 answers

Unique type ID, no RTTI

Following my answer to Unique type ID in C++, I have worked towards a "safer" version that I am posting here. This is a lightweight type that can store a unique (also across compilation units) ID per ...
iavr's user avatar
  • 2,274