The std::type_info
class is non-copyable. This makes it hard to store it in an object for later use. What should I do?
RTTI for basic types such as int and bool is stored in the run-time library. Therefore, object files generated from a C++ program might reference RTTI defined in libc++abi.
std::type_info The class type_info holds implementation-specific information about a type, including the name of the type and means to compare two types for equality or collating order. This is the class returned by the typeid operator.
There is a much better solution in C++11. A new copyable wrapper called std::type_index. You need to include header "typeindex" to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With