July 2018

CppCon 2017: CNL: A Compositional Numeric Library—John McFarlane

Have you registered for CppCon 2018 in September? Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

CNL: A Compositional Numeric Library

by John McFarlane

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

CNL is a numerics library born out of efforts to standardize fixed-point arithmetic.
It provides number types which increase precision, enforce correctness and maintain efficiency.
And by designing these types with composability in mind, the library aims to do for integers what the STL does for pointers.

This introductory talk will show potential users how they can benefit from using CNL in a wide variety of applications. Firstly, the individual components will be illustrated using straightforward examples. Then we'll see how these components slot together to produce powerful new types. Finally I'll detail the steps necessary to adapt existing types to work within the CNL framework.

Along the way, I hope to share some of the insights I've gained while learning about literal types including: why you shouldn't mess with `int` if you want zero-cost abstractions; how C++ is getting better at supporting new number types and my hopes for the forthcoming Numeric TS.

CppCast Episode 160: Parallel Ranges with Christopher Di Bella

Episode 160 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Christopher Di Bella to discuss using Ranges with Parallel algorithms and much more.

CppCast Episode 160: Parallel Ranges with Christopher Di Bella

by Rob Irving and Jason Turner

About the interviewee:

Christopher Di Bella is a Staff Software Engineer for Codeplay’s ComputeCpp Runtime Technology and a C++ teacher. He advocates for including the Concepts TS and the Ranges TS in C++20.

Chris spends his days working on ComputeCpp, Codeplay’s implementation of SYCL, a Khronos Standard for heterogeneous programming in C++; the Khronos implementation for the Parallel STL (using SYCL); and researching Parallel Ranges, which is an attempt to fuse ranges together with the parallel STL.

Chris was previously a software developer for Nasdaq, and a tutor for UNSW Sydney’s advanced C++ and compiler courses. In his spare time, Chris enjoys poking at things involving Ranges, snowboarding, playing games, and watching films.

A Case for p0424 - Sane C++ Serialization—Wojciech Szeszol

Serialization was always a problematic topic in C++. Is it going to change in the future? Check out to see how the string literals as the template parameters can help here.

A Case for p0424 - Sane C++ Serialization

By Wojciech Szeszol

From the article:

Probably every C# developer knows how versatile the Newtonsoft.Json or the standard C# serialization libraries are. The serialization with DataContract or JsonProperty is easy to write, maintain and quite efficient. When we compare it with what C++ have to offer, the latter looks very poorly. We have selection of dedicated reflection/serialization libraries [...]. Unfortunately all of them come with different sets of drawbacks: they require the serialization methods to be written manually, force usage of ugly macros, require manual registration of the structures and their fields or involve additional compilation step for the schema definitions. [...] This may change with the new C++20 standard and the introduction of the string literals as the template parameters.

CLion 2018.2 released: clangd, new project models, sanitizers, and more–JetBrains

CLion is becoming a more mature C/C++ IDE with the new release!

<img alt="" data-cke-saved-src="https://d3nmt5vlzunoa1.cloudfront.net/clion/files/2018/07/800x400_blog@2x.png" src="https://d3nmt5vlzunoa1.cloudfront.net/clion/files/2018/07/800x400_blog@2x.png" 230px;="" height:="" 115px;="" float:="" right;"="">


CLion 2018.2 released: clangd, Gradle and compilation database projects, Google Sanitizers, and database support

by Anastasia Kazakova

From the article:

In this release, we’ve done our best to deliver some very important new capabilities for both groups - our current customers and those still waiting for some critical functionality to be added before they adopt CLion. On the one hand, CLion comes with an experimental complementary clangd-base language engine and a set of important performance improvements. On the other, it introduces support for several new project models (like Gradle C++ and compilation database format), which may open the door to a public project model API in the future.

Database tools and SQL support join CLion 2018.2 as a bundled plugin, which adds DataGrip’s functionality to the IDE. This release also introduces support for Google Sanitizers.

CppCon 2017: Building C++ Modules—Boris Kolpackov

Have you registered for CppCon 2018 in September? Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

Building C++ Modules

by Boris Kolpackov

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ Modules TS is now implemented (to various degrees) by GCC, Clang, and MSVC. The aim of this talk is to provide practical information on the mechanics of creating and consuming modules with these compilers. It is based on our experience adding modules support to the build2 toolchain and then modularizing some of its components.

We start with a brief introduction to C++ modules, why we need them, and how they relate to other physical design mechanisms, namely headers, namespaces, and libraries.

Next we explore the kind of integration modules will require from a C++ build system. Specifically, when and where a module binary interface is built? How can a build system discover which modules are needed? What are the implications for parallel and distributed builds? Can we finally get rid of the preprocessor? And what happens to header-only libraries in this brave new modularized world?

With a firm understanding of the implications C++ modules have on the build process, we can try to answer some of the module design questions: What is an appropriate module granularity? Should we have separate module interface and implementation units? Can we have a dual header/module interface for legacy support? Are module-only libraries to become all the rage?

C++/CLI support comes to ReSharper C++

Two big worlds of C++ and C# are bridged by the interop language, C++/CLI, and now it's supported in ReSharper C++, a Visual Studio extension from JetBrains.

C++/CLI support comes to ReSharper C++

by Phil Nash

From the article:

While C# is a highly productive language, and is no slouch when it comes to performance, there are many reasons that we may also have a parts of our project written in pure C++. C++/CLI is an answer to the question, “how do I get to, or from, my pure C++ from C# (or any .NET language)?”. If you just need to call into C++, and it exposes a C API, P/Invoke may be the simplest way to go. But for more complex cases – where you want to model richer types and class hierarchies – C++/CLI let’s you do that.

PVS-Studio as SAST solution

PVS-Studio is a static application security testing tool (SAST). In other words, the PVS-Studio analyzer detects not only typos, dead code and other errors, but also security weaknesses (potential vulnerabilities).

PVS-Studio as SAST solution

by Andrey Karpov

From the article:

Until recently, in our articles we have positioned PVS-Studio as a tool for detecting errors in code. While we almost never regarded PVS-Studio in a security context. We will try to remedy this situation and take a look at the tool in terms of testing of security applications and DevSecOps practices.

For the convenience of specialists who will use PVS-Studio as a SAST tool, the analyzer provides mappings for its warnings to Common Weakness Enumeration, SEI CERT Coding Standards, and also supports MISRA standard (currently in development).

CppCon 2017: Programming with C++ Constraints: Background, Utility, and Gotchas—Walter E. Brown

Have you registered for CppCon 2018 in September? Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

Programming with C++ Constraints: Background, Utility, and Gotchas

by Walter E. Brown

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Compile-time constraints will likely soon become part of our routine C++ programming vocabulary. Why? Such constraints are induced by new core language features (requires-clauses and requires-expressions) that are on the horizon for C++. What are these all about?

Almost every function imposes requirements on its users; violating those requirements typically leads to incorrect programs. Historically, such requirements had to be expressed in comments or other documentation, as there was little machinery to express them in code. Soon we will be able to express more requirements in code, thus allowing compilers to detect and address more violations.

This talk aims to prepare both new and veteran C++ programmers with the necessary background, tutorial information, and advice to exploit this powerful new supplement to function declarations. A case study, illustrating an unexpected gotcha, will conclude the presentation.