C ++ 'typedef' против 'using… =…' [duplicate]
Possible Duplicate:
What are the differences between typedef and using in C++11?
Следующий код компилируется и запускается. У меня вопрос, в чем разница между & quot; typedef & quot; и "используя" способ переименования шаблона специализации?
template<typename T>
struct myTempl{
T val;
};
int main (int, char const *[])
{
using templ_i = myTempl<int>;
templ_i i;
i.val=4;
typedef myTempl<float> templ_f;
templ_f f;
f.val=5.3;
return 0;
}
Edit:
Если нет разницы, какой из них вы бы предпочли? / Почему была введена версия using ... = ...?