Modern C++ Design にあった。
const な型から const を除去する。
template <typename T> class TypeTraits
{
private:
template <class U> struct UnConst
{
typedef U Result;
};
template <class U> struct UnConst<const U>
{
typedef U Result;
};
public:
typedef typename UnConst<T>::Result NonConstType;
};
なるほどねぇ。