C++ Language/Templates/Traits/UnaryTransformTraits

From Wikibooks, open books for an open world
Jump to navigation Jump to search

A "transform trait" specifies a type that is similar to some other type, but with some added (or removed) characteristics. In this example, variable m_iMember will be a int data member for both specializations T=int and T=int&:
template<typename T> class CRClass { std::remove_reference<T>::type m_iMember; };.

Additional information about unary transform traits