Livestreams Tips & Tricks

Webinar Recording: A Tour of Modern C++

The recording of our July 2nd webinar, A Tour of Modern C++, is now available on JetBrainsTV YouTube channel.

In this webinar, Dmitri Nesteruk shows the latest language additions introduced in C++11 and also talks a little bit about some of the forthcoming features in C++14 and 17.

Demo project is available on GitHub. And if you have any suggestions or improvements, your pull requests are welcome!

The video includes the time stamps following the agenda announced.

Below are some questions from our webinar answered by Dmitri and Anastasia.

Q: How does constexpr work compared with ordinary meta programming?
A: Constexpr allows for a much cleaner way of performing compile-time calculations when compared to template metaprogramming. Instead of making a template class where the template argument is transformed and exposed as some `value` member, you can simply write a function prefixed with `constexpr` and the compiler takes care of the rest.

Q: Is there an overhead using for_each with lamdas(or any stl algorithms) compared with the old for with subscripting?
A: Nope! The range-based for is as fast or faster than doing an ordinary `for`… provided your iteration variable is a reference. If it’s a value, temporaries are created and the generated code is a bit more complicated.

Q: How is the C++11 style return beneficial over just having the return value in front?
A: One of the reasons why it’s there is lambdas. When you do a lambda it’s more natural to put it towards the end, then towards the beginning.
There is a whole business of decltypes. And you simply can’t prefix decltype because at this location in front we don’t know anything about t and u:

Q: It would be great to hear about move semantics.
A: Move semantics is a topic that, unfortunately, did not make it into the webinar. Apart from popular literature, I can recommend looking at this stackoverflow question, which has a succinct description of what it’s all about.

There was also a set of questions about CLion and ReSharper C++. We encourage you to visit our site for both products to learn more. If you are interested in a plugin for Visual Studio, please, visit ReSharper C++ site. And if cross-platform case looks more appealing to you, please, go to CLion site.

About the Presenter:

Dmitri NesterukDmitri Nesteruk is a developer, speaker, podcaster and technical evangelist. His interests lie in software development and integration practices in the areas of computation, quantitative finance and algorithmic trading. His technological interests include C#, F# and C++ programming as well high-performance computing using technologies such as CUDA. He has been a C# MVP since 2009.

Thanks to all the attendees for the questions! If you still have some, please, contact Dmitri or our team.

If you are interested in any particular C++ feature, check the C++ reference. We also recommend Scott Meyers’s “Effective Modern C++” book and Bjarne Stroustrup’s C++11 FAQ for some further reading.

Learn more about C++ tools from JetBrains on our site.

Thank you and develop with pleasure!

image description