CppCon 2017: How to Write a Custom Allocator--Bob Steagall

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:

How to Write a Custom Allocator

by Bob Steagall

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

You'd like to improve the performance of your application with regard to memory management, and you believe this can be accomplished by writing a custom allocator. But where do you start? Modern C++ brings many improvements to the standard allocator model, but with those improvements come several issues that must be addressed when designing a new allocator.

This talk will provide guidance on how to write custom allocators for the C++14/C++17 standard containers. It will cover the requirements specified by the standard, and will describe the facilities provided by the standard to support the new allocator model and allocator-aware containers. We'll look at the issues of allocator identity and propagation, and examine their implications for standard library users, standard library implementers, and custom allocator implementers. We'll see how a container uses its allocator, including when and how a container's allocator instance propagates. This will give us the necessary background to describe allocators that implement unusual semantics, such as a stateful allocator type whose instances compare non-equal. Finally, the talk will provide some guidelines for how to specify a custom allocator's public interface based on the semantics it provides.

CppCon 2018 Program Available

Got take a look!

CppCon 2018 Program Available

From the article:

The program for CppCon 2018 is now live!

We’ll have over 100 regular sessions delivered by the best C++ presenters in the industry, many returning from previous years as well as some exciting new voices. We’ll have six or seven concurrent tracks full of sessions containing C++ best practices and what you need to know about C++17 and even what is planned for C++20...

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/[email protected]" src="https://d3nmt5vlzunoa1.cloudfront.net/clion/files/2018/07/[email protected]" 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.