I\'m experimenting with template-template for fun. I have the following class:
template class T, typename R> class Unit
{
usi
You cannot make an alias for T
. The following was discussed in the committee to make an alias for T
(because a very late C++11 draft contained notes that stated that it is an alias for T
which a Defect Report cleaned up).
// Courtesy of @KerrekSB
template class T, typename R> class Unit
{
template using MyTemplate = T;
// ...
// use e.g. MyTemplate to get T
};
Note while MyTemplate
is the same type as T
, that MyTemplate
is not the same as T
. The wording at http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1286 was supposed to change that, but in the last meeting it was considered to be a very special machinery that doesn't really fit what alias templates turned out to be (own templates), and it was pushed back to review. To get that effect, a using MyTemplate = T;
in future may fit the bill (if proposed and accepted, of course).