News

C++ Annotated: March – May 2016

Today we are happy to share our next compilation of C++ news with you.

Subscribe to the regular C++ Annotated and be the first to get the next edition!

C++ Annotated: March – May

In this edition:

  • Conferences
  • News & Stories
  • Webinars
  • Releases

Conferences

ACCU 2016

accu In April, ACCU came back to Bristol, UK, as usual. The premier UK developer conference this time brought together more than 400 attendees and over 60 speakers. Four playlists with video recordings, one for each day, are already available on YouTube. Lots of interesting topics were covered this year, for example Greg Law’s talk about profound and thus less known GDB features, Diego Rodriguez-Losada’s talk about C/C++ and Python working together, a talk from our developer advocate Dmitri Nesteruk about Design Patterns in Modern C++, and many more.

Besides, ACCU 2016 Chair, Russel Winder, gave JetBrains an interview where he talked about things that make ACCU unique, as well as his experience with Rust, D and Go languages and their future in comparison to C++.

C++Now 2016

cppnow Across the pond, C++Now 2016 was held in Aspen, Colorado, in early May. Attendees could find a lot of well-known names from the C++ community joining the event, like Sean Parent from Adobe with a keynote talk about Better code, Jon Kalb with his famous O’Reilly report about C++ landscape overview, Timur Doumler, a JUCE developer from ROLI, Marshall Clow, Barbara Geller, David Sankel, and many others.

Check out the best session winners and learn about C++Now 2017 dates in the blog post.

Italian C++ Conference 2016

Another C++ event was held in Italy in May. More than 100 people attended the very first Italian C++ conference in Milan. You can find the report about the event here. In particular, we want to draw your attention to two of James McNellis’ talks, Adventures in a Legacy Codebase and An Introduction to C++ Coroutines.

News & Stories

C++17 standard news

cpp March brought several reports about the C++ meeting in Jacksonville, Florida. Herb Sutter posted a long and detailed one in his blog. Despite many expectations and hopes in the C++ community, modules and concepts won’t come to C++17. However, for now they will both stay in their own technical specification. Coroutines are targeted for another TS as well. On the good side, Herb lists the features that are making their way to the upcoming C++ standard, like Parallel STL and several more TS that were merged into the final C++17 edition, and several features coming directly to the new standard like fallthrough, nodiscard and maybe_unused attributes and more. The future of C++ is presented in Herb’s blog post in a simple timeline, followed by an interesting open-ended question: Will C++ stay on the 3-year cycle or move to a 2-year cycle?

C++11 smart pointers

C++ developers (both students and professionals) can find this blog post useful, as it uncovers 10 dangerous pitfalls when working with C++11 smart pointers. It tells you where it’s better to use shared_ptr, unique_ptr and auto_ptr; how to avoid double memory allocation by using make_shared; and lays out the rules for working with the raw pointers.

lambdas and std::function

lambda C++11 lambdas are already widely used. The idea is pretty simple. The easiest (though probably useless) example is “[](){}();”. But do we know them well enough to answer even basic questions? What is the lambda’s type and why is it not std::function? How long do the variables captured by lambda stay alive? What is the size of a lambda? If you feel like testing your knowledge of lambdas, head straight to this blog post.

Conan

conan In the previous edition we already mentioned Conan, a C/C++ package manager. This time we’d like to share more information about it. First up is a CppCast episode with Diego Rodriguez-Losada, known as a biicode startup co-founder and currently Conan committer. Watch the episode to learn the Conan story first-hand.

There is also a great post in Conan’s blog for those interested in setting up a full environment for C/C++ development based on Clang as the compiler, CMake as the build system, CLion as the IDE, and Conan as the package manager. Check the steps and follow advices for an easy set-up.

Compiler Bugs Found When Porting Chromium to VC++ 2015

64_read Bruce Dawson from Google posted some great material on the bugs found while porting a big Chromium project from VC++2013 to VC++ 2015. The incredible work includes attempts to build some smaller samples to reproduce the problems, as well as some deeper analysis of the situations. Read the post to know about a problem with zeroing a five-byte array, a crash that would happen only under Profile Guided Optimization, an incorrect 64-bit structure read, and more.

Telemetry function calls in VS 2015

telemetry Recently the C++ community has been discussing the telemetry call in every binary compiled in VS2015. The discussion was huge as conspiracy theories are always popular, even though the logs written in that case were quite limited and have to be switched on manually (so not working by default).

However, the discussion on reddit got an official comment. Steve Carroll from the Visual C++ team has promised that the corresponding calls will be removed in Update 3. He explained that the main intent was to build a framework that would help investigate performance problems and improve the quality of the optimizer.

C++ I/O Benchmark

compilers Cristian Adam posted in his blog nice and solid benchmark for C++ cross-platform calls for Input/Output on Windows 10, Kubuntu 15.10 and Raspberry PI2, testing on a huge set of compilers: GCC, Clang, Visual C++ (2013/15), MinGW GCC, Cygwin GCC and Cygwin Clang. During the test he was reading one file in chunks of 1 MB and writing it to another file. The tested API calls were: C file API (fopen, fread, fwrite), C++ API (std::ifstream, std::ofstream) and POSIX API (open, read, write). And the winner’s crown went to… POSIX. See the full blog post for some interesting numbers.

CppCast

cppcast
CppCast continues gathering famous C++ community members. Jens Weller talked about the Meeting C++ platform that brings the conference, site and recruiting platform to the C++ world. Get the whole story first-hand. An interview with the author of the renowned blog Simplify C++, Arne Mertz, was recorded for CppCast in March. Find the discussion of the latest standard and more topics in there. April brought an interesting discussion with Ankit Asthana about cross-platform development, Visual Studio Code and Visual Studio for Linux. Elena Sagalaeva (known by the Russian-speaking community for her famous blog on C++ in Russian) attended the podcast in April as well, talking about distributed computing and how the latest C++ standards are useful there.

Webinars

Design Patterns and Modern C++

The recording of our May 24th webinar, Design Patterns and Modern C++, is now available on JetBrainsTV YouTube channel. In this webinar Dmitri Nesteruk shows how the classical design patterns that arose in 1994 from the infamous Gang of Four book continue to be as useful to this day. We are discussing the adapter pattern, the builder pattern and the maybe monad. Several questions from the webinar answered by Dmitri can be found in the corresponding blog post.

Releases

GCC 6.1

gcc-logo The new major release of GCC compiler was announced and brought lots of goodies. First of all, C++14 is set as a default. Besides, many features from the upcoming C++17 were added to the compiler (for both language and standard library), and even Concepts, that were postponed by the committee to another TS, are available in GCC 6.1 via -fconcepts.

Checking the list of the General Optimizer Improvements in the release notes, you may notice an interesting point that C++ developers definitely should heed: “Value range propagation now assumes that the this pointer of C++ member functions is non-null”. You may want to check whether your code base is affected by the change, just as it happened to Qt5, Chromium and KDevelop. Anyway, GCC authors suggest a temporary workaround: -fno-delete-null-pointer-checks.

Clang 3.8

libclang A lot of goodies were delivered with the Clang 3.8 release, including OpenMP 3.1 (and several elements of the OpenMP 4.0/4.5), experimental support for end-to-end CUDA compilation, static analyzer improvements, and more. You can also track the progress of the new features through the Clang 3.9 (in progress) release notes.

ReSharper C++ 2016.1

R++_400x400_Twitter_logo_white April brought the release of ReSharper C++, a Visual Studio extension for C++ developers. In addition to Google Test support, Boost.Test is now added, including a built-in test runner. This version allows you to mark your code with TODO, BUG, FIXME or any other pattern you may prefer (configurable in settings), and navigate through the marks easily using a special Todo Explorer.

The release also brought a long list of new quick-fixes and context actions that help improve the code, by suggesting various fixes. One example is when ReSharper C++ detects an uninitialized constructor parameter, it offers a context action to create and initialize the corresponding field. Find more details about the new version in this blog post.

CLion 2016.1

CLion_400x400_Twitter_logo_white CLion, a cross-platform IDE for C and C++ developers, got an important update. Release 2016.1 finally brought variadic templates support and auto-import for STL symbols. Quick Documentation pop-up was enhanced with the hyperlinks to the related symbols. During debugging users are now allowed to attach to the process running on a local machine but not started from the IDE – all the benefits of the built-in debugger UI are still there.

To speed up the indexing time, CLion 2016.1 lets you mark directories as excluded (several more option like libraries or sources are also available).
Overgrowing just C and C++ development, CLion turns to the multi-languages projects bringing Python and Swift support on board. Feel free to check the details in the CLion’s blog.

Finally, CLion started a new Early Access Program for version 2016.2. This build addresses Doxygen support, Complete Statement and VCS changes, CMake rename refactoring for users symbols and more.

Qt Creator 4

qt Qt came out with big news in May and released Qt Creator 4.0.0. It includes CMake workflow changes (like automatic triggering when necessary, UI to change the CMake configuration for a build directory and more), automatic use for the Clang code model, Clang static analyzer integration available under open source, fixes for the latest LLDB version and several more improvements.

Visual Studio 2015 Update 2

vs_cpp Microsoft has given us a lot of exciting news in these months. Update 2 comes with many interesting changes for C++ developers. C++ compiler got many bug fixes, with the most notable changes including support for Variable Templates and constexpr improvements. At the same time, many C++17 features have made their way to C++ standard library as well.

However, the biggest improvement is probably for those who develop for Linux, as the new extension makes possible C++ development in Visual Studio for Linux. You can now create projects and manage connections to the Linux machine right from the VS. Upon connecting, VS will copy your sources to the remote Linux machine and will invoke GCC to build the sources with the options from the project properties. Then you can debug your code remotely.

Looking into the future of Visual C++ compiler, read this blog post about upcoming changes in Visual C++ code optimizer. Find out the reasons behind the new optimizer, and see several samples of implemented optimizations.

That’s it! Let us know in the comments if you like current edition.

Cheers,
The C++ Team

image description