September 2017

Automatic two-phase init—Krzysztof Ostrowski

Deferred initialisation for classes that inherit constructors, or Automatic two-phase init.

Deferred initialisation for classes that inherit constructors

by Krzysztof Ostrowski

From the article:

Constructor inheritance through using-declaration is a powerful technique that can be easily used to introduce pre-defined behaviour to custom types. As an example, consider a generic visitor design pattern implementation that is parametrised by the names of visitable types, and an unique tag that identifies given visitor template instance. Such an instance can be "mixed-in" into a custom type D by simply deriving from it... and inheriting its constructors to make it behave as it would be a Visitor template instance itself:

struct D
  : Visitor<
        A         // the tag
      , X, Y, Z   // "list" of visitable types
      >
{
    using Visitor::Visitor;
};
What if there is a need to run an "additional" initialisation code as it would be run in the D constructor if one were there? Bjarne Stroustrup suggests member-initializers that do half of a work we would like to do here. While direct member initialisation sets required initial values for all the members (except bit field members), it does not offer a direct way to execute custom code that makes use of those members, the custom code that typically resides in the constructor's body.
This article presents a solution that enables injection of a custom code to be executed once all the non-static members are initialised.

LLVM 5.0 Released

The 5th major version of the LLVM compiler infrastructure was released.

LLVM 5.0 Released

by the LLVM Team

About the release:

The Clang releated changes are documented on an extra page.

C++ coroutines are the major new feature. Beside that, C++17 feature implementation has been completed.

 

 

What’s new in clang-format 5

A good way to simplify your life:

What's new in clang-format 5

by Benoît Blanchon

From the article:

Clang 5 was released last week.
It's a good opportunity to talk about a not-enough-known tool: Clang-format.

Clang-format is part of the Clang project but can be used without the Clang compiler. It's an independent executable.

Clang-format is a code linter for C++. It takes a non-formatted code as input and produces a well-formatted code as output. The result is instantaneous.

Just::Thread Pro v2.5.0 released with coroutines support—Anthony Williams

A new version is out.

Just::Thread Pro v2.5.0 released with coroutines support

by Anthony Williams

From the article:

I am pleased to announce that Just::Thread Pro v2.5.0 has been released. This adds support for gcc 7, clang 4.0 and clang 5.0, but the big change with this version is the support for coroutines with Microsoft Visual Studio 2017, and clang 5.0 on ubuntu when used with libc++ 5.0.

CppCast Episode 118: FluentC++ with Jonathan Boccara

Episode 118 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Jonathan Boccara to talk about the FluentC++ blog and the benefit of doing daily C++ talks at your office.

CppCast Episode 118: FluentC++ with Jonathan Boccara

by Rob Irving and Jason Turner

About the interviewee:

Jonathan Boccara is a passionate C++ developer working for Murex on a large codebase of financial software. His interests revolve around making code expressive. He regularly blogs on Fluent C++, where he explores how to use the C++ language to write expressive code, make existing code clearer, and also about how to keep your spirits up when facing unclear code. Jonathan loves writing, making videos, reading programming books, hanging out at conferences, meeting people, learning new languages and making trainings and presentations.

C++ for Embedded Developers, 25-29 September, UK

Join us to gain practical experience of writing C++ for real-time and embedded systems in Swindon, UK.

C++ for Embedded Developers

About the course:

This course is designed for:

  • real-time engineers embarking on a project using C++ for the first time
  • developers looking to move from C to C++ (as it will clearly demonstrate both the strengths and weaknesses of C++ vs. C)

Course overview

The course introduces the C++ language for use on real-time and embedded applications. It highlights areas of concern for real-time and embedded development. The focus is on developing core object-oriented programming skills and understanding of how to build effective, maintainable and efficient C++ programs.

Attendees perform hands-on embedded programming, on target hardware, during course practicals. Approximately 50% of the course is given over to practical work.

Course objectives

  • To provide a solid understanding of the essentials of the C++ programming language.
  • To give you practical experience of writing C++ for real-time and embedded systems.
  • To give you the confidence to apply these new concepts to your next real-time project.

Delegates will learn

  • The core C++ syntax and semantics
  • How to access hardware in the language
  • How to program interrupt handlers in C++
  • About memory and performance issues associated with C++
  • How real time operating systems (RTOS) affect the use of the language

Two-phase name lookup support comes to MSVC—Andrew Pardoe

What two-phase name lookup entails, what’s currently implemented in MSVC, and how to make effective use of MSVC’s partial but substantial support for two-phase name lookup:

Two-phase name lookup support comes to MSVC

by Andrew Pardoe

From the article:

“Two-phase name lookup” is an informal term that refers to a set of rules governing the resolution of names used in a template declaration...