This question already has answers here: Can I obtain C++ type names in a constexpr way? (3 answers) Closed 1 year ago.
I\'m micro-optimizing code for identifying object types. I assume I can use the following for checking whether two objects instantiated in the same module have identical types:
If I call typeid and retrieve the address of returned type_info: const type_info* info = &( typeid( Something ) );
I have a set of polymorphic C++ classes and they are all instantiated by the same module (Windows DLL). Now having two pointers to such classes and having called typeid:
This question already has answers here: Closed 11 years ago. Possible Duplicate: GCC C++ Linker errors: Undefined reference to 'vtable for XXX', Undefined reference to 'ClassName::
I tried to create a container for posible metadata that can be attached to my objects. I can guarantee that there will be at most one object af each kind attached to my class but there is no limit for
I hava asegmentation fault. debug with gdb, the first开发者_JAVA百科 frame in the stack is in the typeinfo for MyClass()
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?There is a much better solution in C++11. A new copyable wrapper ca
Let\'s say I have a few variables of different types. int MyInteger; double MyDouble; char MyChar; Pointers to these variables are stored in a single array of void pointers.
Here is what I would like to do: From a boost::any I would like to know it is a pointer type. If it is a pointer, I have开发者_如何学运维 to clone it