Since I spend almost all my time at work with C++, I can’t help but become excited about C++11.
I suspect that he following new features alone will vastly ease my life.
1) Lambda functions. I loathe writing out of scope static functions for simple one-liner callbacks… and then having to come up with a suitable name for it.
2) Type inference with the auto keyword. So I can say auto blah = my_vector.begin() instead of vector::iterator blah = my_vector.begin().
3) Range-based for. So I can replace this:
for (vector::iterator i = my_vector.begin(); i != my_vector.end(); ++1) { … }
with this:
for (auto s : my_vector) { … }
(I’ve waited far too long for you, range-based for.)
4) Variadic templates. I love tuples for simple programs and tests. Variadic templates allow for std::tuple. Therefore, I love variadic templates.
tuple GetIntAndString(…) { …; return make_tuple(an_int, a_string); }
auto boo = GetIntAndString(…);
DoSomethingWithInt(get(boo));
Obviously, there is a lot more C++11 has to offer, and you should really check out the Wikipedia article. But IMO, these features alone will help reduce RSI, help prevent hair loss, and let you leave work early so you can go home and code in some other language.
I’ll like c++ if it becomes LPC 😉
LikeLike