Я хотел бы выполнить typedef
, тогда и только тогда, когда выполняется условие времени компиляции. Если условие не выполнено, то typedef
должно выполняться вообще.
Возможно ли это в С++ 11?
Пример:
class A {
std::conditional_typedef<true,int,myType1>; // Performs "typedef int myType1".
std::conditional_typedef<false,int,myType2>; // Does nothing at all.
};
Я ищу этот вымышленный std::conditional_typedef
.