August 2020

C++ Lambda Story is 100% Complete

Will you read it?

C++ Lambda Story is 100% Complete

by Bartlomiej Filipek

From the article:

I’m pleased to announce that I’ve finished the work on the latest update for C++ Lambda Story! This makes the book complete now, and I can finally set its status to 100%! Read on to see the latest changes. It got more than 50 new pages!

CppCon Academy 2020

Are you interested?

CppCon Academy 2020

From the article:

CppCon Academy, the classes that we host before and after the main conference days, has successfully recruited from among the top C++ instructors in the world...

CppCon 2019: Everyday Efficiency: In-Place Construction (Back to Basics?)--Ben Deane

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Everyday Efficiency: In-Place Construction (Back to Basics?)

by Ben Deane

Summary of the talk:

Efficient C++ has always been about minimizing copies. This practically-focused
talk is about how to do that when working with move semantics, perfect
forwarding and STL containers, or non-STL containers that present similar
interfaces.

In-place construction is an easily stated goal, but can be really fiddly to get
right, especially given the foibles of various container interfaces. We'll talk
about copy elision; when to use emplace, insert, or other methods; vectors,
maps, optionals, variants; and how things change from C++11 through C++20.
Attendees will learn why in-place construction is beneficial and exactly how to
achieve optimal efficiency with the various standard container types.

CppCon 2019: 10 Techniques to Understand Existing Code--Jonathan Boccara

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

10 Techniques to Understand Existing Code

by Jonathan Boccara

Summary of the talk:

One of the reasons why a lot of us work in C++ is because there is a huge amount of existing projects written in C++.

But existing code can be hard to understand.

In this presentation, you will learn how to make sense of code quickly, from the general big picture of the codebase all the way down to the little details of the code of a complex class.

The ten rules covered in this session will teach you to:
- start reading code from the end
- identify the parts of code that carry the most information
- locate the code of any feature visible in the application
- and many more!

Code reading techniques usually come with years and years of experience. This presentation will teach some of them to you right now, supported by code examples.

There is a wealth of talks about how to write C++ code using the latest features of the language, but there are very few talks about reading existing code. In particular the everyday code that people have in their codebases. And as the saying goes, code is read much more often than it is written.

This presentation aims at filling this need in a practical way, by exposing 10 techniques that conferences attendees can use on an everyday basis to understand quickly the code they get to work on, as soon as they go back to the office after the conference.

See My Talk: Empty Base Class Optimisation, [[no_unique_address]] and other...--Bartlomiej Filipek

Will you use it?

See My Talk: Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes

by Bartlomiej Filipek

Summary of the talk:

Sometime in 2016, I wrote an article about custom deleters for smart pointers.

Bartek’s coding blog: Custom Deleters for C++ Smart Pointers

And there is an interesting property that if you have a unique_ptr and you provide a stateless functor, then the size of unique_ptr is just one pointer (not two when you use a function pointer). But at that time, I didn’t investigate what the exact reason behind this capability was.

Then in February 2020, I gave a presentation on our C++ User Group about all of the C++20 features. And among them, there’s a new attribute called [[no_unique_address]]. At that time, I also had no clear idea of what were the use cases for it.

But then I wanted to understand more of C++20 and somehow those two features: deleters for unique_ptr and [[no_unique_address]] started to “converge”.

As it appears with the new attribute from C++20, we can significantly simplify the code that leverages Empty Base Class Optimisation to create things like “compressed pairs” often used to store stateless callable objects like allocators or deleters.

Thirty Years C++. Interview with Bjarne Stroustrup--Roberto V. Zicari

An interesting read.

Thirty Years C++. Interview with Bjarne Stroustrup

by Roberto V. Zicari

From the article:

“If you keep your good ideas to yourself, they are useless; you could just as well have been doing crossword puzzles. Only by articulating your ideas and making them accessible through writing and talks do they become a contribution.” –Bjarne Stroustrup

Back in 2007 I had the pleasure to interview Bjarne Stroustrup, the inventor of  C++ programming language. Thirteen years later…, I still have the pleasure to publish an interview with Bjarne...

Reminder: CppCon 2020 early bird registration ends in two days

cppcon2020-basic.PNGJust a reminder, early bird registration for the all-virtual CppCon 2020 ends in two days. Register soon to get the reduced rate for you and your team members! After August 5th, registrations will still be available at the regular rate.

CppCon 2020 will be held as an online conference. Registered attendees will get the full experience:

  • Talks delivered live, with live Q&A opportunities with speakers during their talks and in the "hallway track."
  • Virtual exhibitor booths, where you can interact live via videoconference with your favorite C++ product's developers.
  • The "hallway track," live video chat with other attendees at virtual tables with whiteboards.
  • ... and much more, including lightning talks, additional pre/post-conference classes, and the CppCon house band performing live from their studio in Seattle.

As always, the talk videos will be made freely available to everyone online about a month or two after the event. The other parts of the conference are not recorded, but are available live.

CppCon 2019: Naming is Hard: Let's Do Better--Kate Gregory

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Naming is Hard: Let's Do Better

by Kate Gregory

Summary of the talk:

C++ developers are famously bad at naming: our idioms, guidelines, and lore are rich in examples of terrible names. For example, consider RAII, which stands for scope bound resource management, or west const which perhaps should be const west, or all the samples that feature an object called x which is an instance of a class called X, and so on.

The good news is that naming well is a learned skill, and you can learn it, and start to name better right away. In this talk, I'll tell you why names matter, what benefits a good name can bring, and how to be better at naming. I'll discuss some categories of names and some common decisions within those categories. I'm not going to give you a set of rules to follow: this is about thinking and considering the meaning of the things you are naming. I will give you some questions to ask yourself and some structure that I use to help me to help those who read what I write.

I'll also address renaming things in existing (legacy) code, why and when to do it, and why getting it right the first time may not even be a realistic goal. You should be a lot more confident naming things after we spend this time together.