Re:Elements of Modern C++ Style
by CJefferson on Saturday October 29, 2011 @06:15PM
(#3172959)
Exactly right, in C++03 this kind of stuff was really horrible.
In general people (the STL, and all Maths code I've ever read), will just assume that the type is T. For things like iterators, you have to do things like:
typename std::vector<T>::const_iterator it = v.begin();
(That typename has to be there, for stupid C++ reasons). Being able to reduce that to:
auto it = v.begin();
Is probably the most visible advantages to C++11 is one of the most obvious improvements for many programers.
In general people (the STL, and all Maths code I've ever read), will just assume that the type is T. For things like iterators, you have to do things like:
(That typename has to be there, for stupid C++ reasons). Being able to reduce that to: Is probably the most visible advantages to C++11 is one of the most obvious improvements for many programers.