December 2015

CppCast Episode 37: Ranges with Eric Niebler

Episode 37 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Eric Niebler to discuss his work on Ranges and the future of the Standard Library.

CppCast Episode 37: Ranges with Eric Niebler

by Rob Irving and Jason Turner

About the interviewee:

Eric Niebler is an independent consultant specializing in C++ library development. Currently, he is working on modernizing the C++ standard library and adding support for ranges, funded by the first-ever grant from the Standard C++ Foundation. Previously, Eric was a consultant for BoostPro computing, a member of Microsoft's Visual C++ team, and a Microsoft Researcher before that. In addition, he has several libraries in Boost and is a Boost release manager and steering committee member. Eric has been an active member of the C++ Standardization Committee for well over 10 years. He speaks regularly at C++ conferences around the world.

In a previous life, Eric drifted with no fixed address, writing C++ and blog entries from cafes and beaches around the world. Today, Eric is a family man living and working in the glorious Pacific Northwest near Seattle.

Oracle Solaris Studio 12.5 Beta

O_SolarisStudio.gifOracle Solaris Studio 12.5 Beta Release

The Oracle Solaris Studio 12.5 Beta release is now available for download from OTN.  Oracle Solaris Studio delivers highly optimized compilers, advanced analysis tools and a multi-language aware IDE for easy development of fast, reliable and secure applications for Oracle Solaris and Linux operating systems.

Key Benefits:

  • Increased application security with Oracle SPARC M7 Silicon Secured Memory integration and built-in security checking capabilities.
  • Latest language standard support, including C++14, C++11 and C11, and easy compilation of open source applications with improved GCC compatibility.
  • Performance optimizations for the latest Oracle systems and updates throughout the tool suite for creating faster applications, faster

Modern Asynchronous Request/Reply with DDS-RPC -- Sumant Tambe

rtidds.PNGThis article is considers lots of approaches to solving a concurrency problem, but of particular interest are the sections showing the power of the Concurrency TS future.then extension and the coroutines proposal:

Modern Asynchronous Request/Reply with DDS-RPC

by Sumant Tambe

From the article:

A quick look into N4402 reveals that the await feature relies on composable futures, especially .then (serial composition) combinator. The compiler does all the magic of transforming the asynchronous code to a state machine that manages suspension and resumption automatically. It is a great example of how compiler and libraries can work together producing a beautiful symphony.

... Indeed, this is truly an exciting time to be a C++ programmer.

Trip Report: using std::cpp 2015 at Spain

On November 18th 2015, for the third year in a row, we had a C++ day in Spain. Our local event using::std cpp 2015 starts to consolidate as an annual event for the Spanish C++ community. Each Fall more than 100 developers join some academics and students to exchange experiences about using C++.

My full English language trip report can be found here:

Trip report: using std::cpp 2015

DISCLAIMER: Please, note that all talks where given in Spanish. We will be publishing the slides and videos in the next days. However, we feel that this activity is of interest for a wider audience...

Dive into C++14 - [3] - Generic "unique resource" wrapper

Vittorio Romeo expands the Dive into C++14 series with a new video covering the implementation of a generic "unique resource" wrapper.

Dive into C++14 - [3]

About the tutorial:

This new tutorial covers the implementation of a generic "unique resource" class, with the same ownership semantics as std::unique_ptr.

std::unique_ptr is not limited to pointer-like handles - by adapting other kinds of handles to the `NullablePointer` concept, it can still be used. Nevertheless, for educational purposes and to understand the commonalities between resource types and handle types, we're going to implement our own std::unique_ptr-like generic "unique wrapper".

The video shows the implementation of the resource class and the abstraction of the behavior of several example resource types (heap-allocated pointers, OpenGL VBOs, int-based-handle APIs).

All the code is available on GitHub. The code segments are thoroughly commented and can be read as a tutorial without watching the video, if preferred.

C++ Static Analysis using Clang -- Ehsan Akhgari

How to write/use C++ static analyzer using Clang.

C++ Static Analysis using Clang

by Ehsan Akhgari

From the article:

Large code bases typically develop rules around how various code constructs should be used.  These rules help eliminate bugs resulting from common mistakes.  C++ gives programmers a good amount of power over enforcing such rules using the facilities that the language provides.  As a simple example, if you have a class that should not be inherited from, you can mark the class as final.

Typically one finds themselves in a situation where the language doesn’t provide an easy way to enforcey something.  In that case, the solution is typically enforcing the rules through documentation, code review, etc.  Besides the obvious downside of people making mistakes when checking for these rules, detecting violations of the some rules may be completely impractical.

Clang with Microsoft CodeGen in VS 2015 Update 1--Dave Bartolomeo

You can now easily verify if Clang can compile your code on Windows:

Clang with Microsoft CodeGen in VS 2015 Update 1

by Dave Bartolomeo and the Clang/C2 feature crew

From the article:

One of the challenges with developing and maintaining cross-platform C++ code is dealing with different C++ compilers for different platforms. You write some code that builds fine with the Visual C++ compiler for your Windows-targeting build, but then your Android-targeting build breaks because Clang is stricter about standards conformance and your code was accidentally depending on Visual C++ being more permissive. Or, you write new code that builds successfully with Clang for iOS, only to find out that you used a relatively new C++ language feature that Visual C++ does not yet support, and now you have to either re-implement the code without using that language feature, or maintain a separate implementation that works with Visual C++ for your Windows build.

To make it easier to develop cross-platform code that works well for both Windows and other platforms, we’ve released an additional compiler toolset for Visual Studio called Clang with Microsoft CodeGen. This compiler uses the open-source Clang parser for C and C++, along with the code generator and optimizer from the Visual C++ compiler. This lets you compile your cross-platform code for Windows using the same Clang parser that you use for other targets, while still taking advantage of the advanced optimizations from the Visual C++ optimizer when you build for Windows. Because the new toolset uses the same Clang parser used for non-Windows targets, you won't need to have annoying #ifdefs throughout the code just to account for differences between the compilers. Also, your code can take advantage of language features that are not currently available in the Visual C++ compiler, including C99 complex types and C++14 extended constexpr support. And because the Clang-based compiler generates the same debug information format as the Visual C++ compiler, you'll still be able to debug your code with the same great Visual Studio debugger experience.