typeid
Why is std::type_info noncopyable? Am I allowed to store it somewhere?
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[详细]
2023-02-17 10:38 分类:问答typeid doesn't return correct type
cout << typeid(int&).name(); This, in my opinion, sh开发者_开发技巧ould return int& as a type, not an int, but on GCC 4.5.1 and on VS2010 SP1 beta it returns int. Why is this?This is h[详细]
2023-02-13 21:39 分类:问答2d STL vector typeid
I have various 2D vectors and I want to query their differing types at runtime. It appears this is possible on an \"empty\" vector, e.g.:[详细]
2023-02-12 11:58 分类:问答Strange behaviour of the typeid operator?
Using XCode 3.2.3 (64-bit), I get following strange output. What am I doing wrong? #include <iostream>[详细]
2023-02-03 20:56 分类:问答How does typeid work and how do objects store class information?
http://en.wikipedia.org/wiki/Typeid This seems to be a mystery to me: how does a compiler stores information about the type of 开发者_如何转开发an object ? Basically an empty class, once instantiated[详细]
2023-02-03 02:10 分类:问答C++ : Mixing : boost::any + typeid + pointer : clone 'generic' value if it is a pointer
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[详细]
2023-01-29 12:20 分类:问答C++: type_info to distinguish types
I know that compilers have much freedom in implementing std::type_info functions\' behavior. I\'m thinking about using it to compare object types, so I\'d like to be sure that:[详细]
2023-01-25 14:07 分类:问答typeid for polymorphic types
I expected this code to print \'Same 1\' and \'Same2\', but it prints only \'Same1\': #include <iostream>[详细]
2023-01-25 06:19 分类:问答typeid operator in C++
I have the following code int main() { cout << \"Please enter your name...\" << endl; cin >> name;[详细]
2023-01-16 03:00 分类:问答Why switch expressions of type 'System::Guid' are illegal?
void Foo(Type^ type) { System::Guid id = type->GUID; switch (id) { case System::Byte::typeid->GUID: ...[详细]
2023-01-08 10:22 分类:问答