在线文档教程
C++
应用 | Utilities

std::type_info

性病::类型[医]信息

Defined in header
class type_info;

全班type_info保存有关类型的实现特定信息,包括类型的名称和比较两种类型的方法,以求相等或排序顺序。这是由typeid接线员。

type_info类都不是CopyConstructible也不CopyAssignable...

成员函数

(constructor) deletedhas neither default nor copy constructors (public member function)
(destructor) virtualderived objects are safe to delete through pointer-to-base (virtual public member function)
operator= deletedcan not be copy-assigned (public member function)
operator==operator!=checks whether the objects refer to the same type (public member function)
beforechecks whether the referred type precedes referred type of another type_index object in the implementation defined order, i.e. orders the referred types (public member function)
hash_code (C++11)returns a value which is identical for the same types (public member function)
nameimplementation defined name of the type (public member function)

另见

type_index (C++11)wrapper around a type_info object, that can be used as index in associative and unordered associative containers (class)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/type/type[医]信息