3 ms·
"Using" also allows you to have templated aliases, unlike typedefs. There's really no reason to use typedefs.
by lordvon 9y ago
"Using" also allows you to have templated aliases, unlike typedefs. There's really no reason to use typedefs.
- jchw 9y agoWell, of course, there is ONE reason: Having to use old compilers or old standards for other reasons. I imagine a lot of people are in that place with C++. Personally I've followed C++ for a long time as a hobby and it seems like it's finally getting to where it wants to be. But I'll talk to someone who works writing C++ and the idea of being able to use C++17 is a distant dream. For Open Source developers and hobbyists though, you might as well take advantage of whatever features Clang+GCC+MSVC offer. I wish someone would standardize `#pragma once` so I don't have to feel guilty using it.
- lordvon 9y agoYeah so the only reason you wouldn't use 'using' is when you can't :) Modern c++ is awesome. I definitely appreciate being able use c++14 where I work (as well as 'pragma once'). I really look forward to being able to use c++17.
- pjmlp 9y ago> I wish someone would standardize `#pragma once` so I don't have to feel guilty using it. It is called C++ Modules Technical Specification. :)