boost::openmethod::policies::std_rtti::fn::type_index

Returns a key that uniquely identifies a class.

Synopsis

static
std::type_index
type_index(type_id type);

Description

C++ does not guarantee that there is a single instance of std::type_info per type. std_rtti uses the addresses of std::type_index objects as type_id`s. Thus, the same class may have multiple corresponding `type_id`s. `std::type_index objects, on the other hand, are guaranteed to compare as equal iff they correspond to the same class, and they can be used to identify the `type_id`s pertaining to the same class.

Return Value

A std::type_index for type (cast to a const std::type_info&).

Parameters

Name Description

type

A type_id.

Created with MrDocs