Sometimes getting and storing at runtime information about template type is
required. For such cases usually used a construction like <codeclass="computeroutput"><spanclass="special">&</span><spanclass="keyword">typeid</span><spanclass="special">(</span><spanclass="identifier">T</span><spanclass="special">)</span></code> or C++11 class <codeclass="computeroutput"><spanclass="identifier">std</span><spanclass="special">::</span><spanclass="identifier">type_index</span></code>.
<codeclass="computeroutput"><spanclass="keyword">typeid</span><spanclass="special">(</span><spanclass="identifier">T</span><spanclass="special">)</span></code> and
<codeclass="computeroutput"><spanclass="identifier">std</span><spanclass="special">::</span><spanclass="identifier">type_index</span></code> require Run Time Type Info
some compilers have bugs and do not correctly compare <codeclass="computeroutput"><spanclass="identifier">std</span><spanclass="special">::</span><spanclass="identifier">type_info</span></code>
across shared libraries
</li>
<liclass="listitem">
some implementations of <codeclass="computeroutput"><spanclass="keyword">typeid</span><spanclass="special">(</span><spanclass="identifier">T</span><spanclass="special">)</span></code>
do not strip const, volatile and references
</li>
<liclass="listitem">
only a few STLs have <codeclass="computeroutput"><spanclass="identifier">std</span><spanclass="special">::</span><spanclass="identifier">type_index</span></code>
implementation
</li>
<liclass="listitem">
no easy way to store type info without stripping const, volatile and references
</li>
<liclass="listitem">
no nice and portable way to get human readable type name