A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/typeinfo/type_info/ below:

class

<typeinfo>

std::type_info

Type information type

Stores information about a type.

An object of this class is returned by the typeid operator (as a const-qualified lvalue). Although its actual dynamic type may be of a derived class.

It can be used to compare two types or to retrieve information identifying a type.

typeid can be applied to any type or any expression that has a type.


If applied to a reference type (lvalue), the type_info returned identifies the referenced type. Any const or volatile qualified type is identified as its unqualified equivalent.

A typedef type is considered the same as its aliased type.

When typeid is applied to a reference or dereferenced pointer to an object of a polymorphic class type (a class declaring or inheriting a virtual function), it considers its dynamic type (i.e., the type of the most derived object). This requires the RTTI (Run-time type information) to be available.

When typeid is applied to a dereferenced null pointer, a bad_typeid exception is thrown.

The lifetime of the object returned by typeid extends to the end of the program.

The copy and assignment operators of type_info are private: objects of this type cannot be copied.

The copy and assignment operators of

type_info

are deleted: objects of this type cannot be copied.

See

type_index

for a wrapper class that adapts

type_info

values to make them copyable and indexable with standard hash values.



Member functions
operator==
Compare types (public member function)
operator!=
Compare types (public member function)
before
Compare order of types (public member function)
name
Get type name (public member function)
hash_code
Get type hash code (public member function)

Note: No public copy-constructor or copy-assignment.

See also
bad_typeid
Exception thrown on typeid of null pointer (class)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4