typeid
What is the Scala equivalent of C++ typeid?
For example, if I do scala> val a = Set(1,2,3) a: scala.collection.immutable.Set[Int] = Set(1, 2, 3)[详细]
2023-03-30 01:40 分类:问答Will equal type_info addresses mean equal types?
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:[详细]
2023-03-27 15:28 分类:问答What's the lifetime of the object returned by typeid operator?
If I call typeid and retrieve the address of returned type_info: const type_info* info = &( typeid( Something ) );[详细]
2023-03-27 02:15 分类:问答Can type_info pointers be used to distingush types in C++?
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:[详细]
2023-03-27 01:52 分类:问答Using RTTI to determine inheritance graph in C++?
What, if any, c++ constructs are there for listing the ancestors of a class at runtime? Basically, I have a class which stores a pointer to any object, including possibly a primitive type (somewhat[详细]
2023-03-26 16:34 分类:问答When is using 'typeid' the best solution?
There are many reasons not to use typeid.Other than for using members of type_info (implementation defined behavior), 开发者_C百科it is usually (always?) possible to provide similar functionality usin[详细]
2023-03-21 23:26 分类:问答how to create a container that takes one object of each kind?
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[详细]
2023-03-14 10:17 分类:问答C++: Using typeid in production code
Is it generally considered bad practice to use typeid in production code? Also, I noticed typeid returns type_info, which inc开发者_Python百科ludes some metadata (such as a string with the type\'s nam[详细]
2023-03-13 12:33 分类:问答Finding typeid of a template parameter
The print statement 开发者_开发知识库in the constructor\'s definition doesn\'t get printed, isn\'t the constructor calling correct in main? I know I am missing some point here, please point out.[详细]
2023-02-28 01:31 分类:问答dynamic_cast issues: typeid object is not equal, but name is equal
I found that dynamic_cast didn\'t work 开发者_C百科in a situation where I expected it to, and looking at the typeid of the objects at runtime has made the situation even less clear. I just want a cast[详细]
2023-02-24 04:34 分类:问答