Monday, 14 August 2017

C++ typedef versus using

I recently saw some code along the lines:



typedef QuiteALongName::SomeVariable SomeVariable;



My first thought was that it might be better to write the code as:



using QuiteALongName::SomeVariable;


But, being a bit rusty, I couldn't quite put my finger on what the differences would be, or whether there were any 'gotchas' to look out for using either approach. Can anyone offer some wisdom?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...