September 2019

C++ Tricks: Fast RTTI and Dynamic Cast--Samuel Kahn

Only for special cases.

C++ Tricks: Fast RTTI and Dynamic Cast

by Samuel Kahn

From the article:

As introduced in the first post of these series, I will share the first piece of KCL: an implementation of RTTI and Dynamic Cast. The code can be found on GitHub.

If you don’t know what dynamic casting is, then I suggest you read some online resources before diving into this article...

Expressive Code for State Machines in C++--Valentin Tolmer

Compiler checks are the best!

Expressive Code for State Machines in C++

by Valentin Tolmer

From the article:

Have you ever run into this kind of comments?

// IMPORTANT: Do not call this function before calling SetUp()!

Or checks like these:

if (my_field_.empty()) abort();

Those are all symptoms of a (often light-weight) protocol that our code must respect. Or sometimes, you have an explicit protocol that you’re following, such as in the implementation of an SSL handshake or other business logic. Or maybe you have an explicit state machine in your code, with the transitions checked each time against a list of possible transitions.

Let’s have a look at how we can expressively handle these cases...

C++ Russia 2019 Piter

C++ Russia 2019 Piter will be held in Saint-Petersburg, October 31 – November 1, 2019.

C++ Russia 2019

From the article:

Two days, three tracks and dozens of in-depth technical talks about C++: concurrency, performance, architecture, environment — all you need to make your code perfect.


Keynote by Sean Parent, Eric Niebler and Ivan Čukić.


Also at the conference: Marshall Clow, Björn Fahller, Maxim Khizhinsky, Hana Dusíková, Rainer Grimm and many others.


C++ Russia is not only the talks but also networking with hundreds of colleagues from Russia and Europe. Due to dedicated discussion zones, all the speakers have after their talks, all the questions will be answered.

And in the evening you can participate in BoF-sessions where the most uncommon ideas are born.
Fourteen talks will be entirely in English.

CppCon 2019: De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable--Herb Sutter

What do you think about it?

De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable

by Herb Sutter

From the video:

A fundamental reason why C++ is successful and loved is its adherence to Stroustrup’s zero-overhead principle: You don’t pay for what you don’t use, and if you do use a feature you can’t reasonably code it better by hand. In the C++ language itself, there are only two features that violate the zero-overhead principle, exception handling and RTTI – and, unsurprisingly, these are also the only two C++ language features that every C++ compiler has switches to turn off and that are regularly discouraged or even banned. This matters because not using these features is the largest current cause of fragmentation of the C++ community into incompatible dialects, and the cause of recurring problems including type confusion security vulnerabilities arising from “didn’t down-cast using dynamic_cast because that would be too slow.” This talk is about ongoing long-term efforts to try to unify the community in this area, not by replacing exceptions and RTTI, but by doubling down: fully embracing exceptions and RTTI, and improving them so they can be zero-overhead too.

CppCon 2019: Better Code: Relationships--Sean Parent

More are coming!

Better Code: Relationships

by Sean Parent

From the video:

Computer scientists are bad at relationships. Nearly every program crash is rooted in a mismanaged relationship, yet we spend most of our time discussing types and functions and not the relationships connecting them together. This talk looks at common ways data and code are connected in an application, how those relationships are typically represented, and the problems caused by the use, and misuse of these paradigms. Then we'll look at ways to model these relationships in C++ and use them to build correct applications.

fixing c++ with epochs -- Vittorio Romeo

This article covers a possible mechanism that would allow the C++ committee to make breaking changes to the language syntax while still fully preserving backwards compatibility. This would allow dangerous or obsolete constructs to be removed from C++, increasing safety and approachability of the language.

fixing c++ with epochs

by Vittorio Romeo

From the article:

Imagine that you have been designing a programming language for over 30 years and that it gradually became widely used across the globe. Some of the decisions you made at the beginning were excellent and contributed to the success of your project. Some others, however, were not the best: over the years you and your users realized that the world would have been a better place if those choices you made eons ago were slightly different. [...]

What if I told you that I could fix all of your problems? Even better, what if I told you that backward-compatibility will never be broken and that migration to newer versions of your language could be automated?