Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template type_id

boost::typeindex::type_id

Synopsis

// In header: <boost/type_index.hpp>


template<typename T> type_index type_id();

Description

Function to get boost::typeindex::type_index for a type T. Removes const, volatile && and & modifiers from T.

Example:

type_index ti = type_id<int&>();
std::cout << ti.pretty_name();  // Outputs 'int'

Template Parameters:

T

Type for which type_index must be created.

Returns:

boost::typeindex::type_index with information about the specified type T.

Throws:

Nothing.

PrevUpHomeNext