community

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...

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.

CppCon 2019: There Are No Zero-cost Abstractions--Chandler Carruth

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!

There Are No Zero-cost Abstractions

by Chandler Carruth

Summary of the talk:

C++ is often described as providing zero-cost abstractions. Libraries offer up facilities documented as such. And of course, users read all of these advertisements and believe that the abstractions they are using are truly zero-cost.

Sadly, there is no truth in advertising here, and there are no zero-cost abstractions.

This talk will dive into what we mean by "zero-cost abstractions", and explain why it is at best misleading and at worst completely wrong to describe libraries this way. It will show case studies of where this has led to significant problems in practice as libraries are designed or used in unscalable and unsustainable ways. Finally, it will suggest a different framing and approach for discussing abstraction costs in modern C++ software.

CppCon 2019: Converting to C++20 Modules-Nathan Sidwell

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!

Converting to C++20 Modules

by Nathan Sidwell

Summary of the talk:

C++20 will have a module system, which provides benefits beyond simple code hygiene. C++20 modules uses new keywords and explicit source-level annotations. How do we get there from here?

I have been implementing this in the GNU compiler, and will talk about the broad strokes of the module specification.
I will describe how:
* one may incrementally convert source code,
* build systems might be augmented,

CppCon 2019: Maintainability and Refactoring Impact of Higher-Level Design Features--Titus Winters

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!

Maintainability and Refactoring Impact of Higher-Level Design Features

by Titus Winters

Summary of the talk:

Higher levels of abstraction are useful for building things out of, but also have a higher cognitive and maintenance cost. That is, it's a lot easier to refactor a function than it is to change a type, and similarly easier to deal with a single concrete type than a class template, or a Concept, or a meta-Concept ... In this talk I'll present example strategies for refactoring the interface of functions, classes, and class templates. I'll also discuss how the recent addition of Concepts and the proposals for even-more-abstract features affect long-term refactoring in C++. If you're interested in refactoring and it isn't immediately clear that a Concept published in a library can never change, this talk is for you.

CppCon 2019: Back to Basics: Const as a Promise--Dan Saks

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!

Back to Basics: Const as a Promise

by Dan Saks

Summary of the talk:

The const qualifier has various uses in C++. One of the most valuable uses is in declaring function headings that constrain the effects of function calls. Using const appropriately can reduce bugs and development time by turning potential run-time errors into compile-time errors that are much easier to find and correct. Using const can even reduce your program’s code size and execution time.

Despite these benefits, too many C++ programmers still use const reactively rather than proactively. That is, they tend to add const as needed to quell compiler error messages, rather than design const in as they code. To get the most out of const, programmers really need to understand (1) when and where to place const in declarations, (2) when to leave it out entirely, and (3) how type conversions involving const behave.

The key insight about const is to understand const as a promise—a promise not to modify something. This session explains the real meaning of that promise and how that insight can guide you in declaring function parameters and return types. It also explains why you shouldn’t declare by-value parameters and return types as const, why overloading on const is such a useful and ubiquitous idiom, and why it is meaningful to declare constexpr member functions as const.

CppCon 2019: C++20: C++ at 40--Bjarne Stroustrup

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!

C++20: C++ at 40

by Bjarne Stroustrup

Summary of the talk:

It is now 40 years since C++ (then called C with Classes) had its first non-research user. It is now 35 years since the first commercial release of C++. It is now 30 years since the start of the standards process.

So what is C++? I will try to explain what's great about C++, C++20, as a modern language, not treating it as a layer cake of features. Imagine you have never heard of C, C with Classes, or C++11. How do classes, templates, and lambdas fit together? What have constructors and destructors to do with exceptions? What's in the standard library? How can we start using C++?

Finally, I will make a few comments about how to get from older styles of C++ use to modern C++ and point to areas where we need to improve C++ further.

8 years of Meeting C++

8 years ago in 2012, Meeting C++ got started!

8 years of Meeting C++

by Jens Weller

From the article:

In 2012 Meeting C++ got started in July. Planned first to be a one off conference, now it is a successfull international conference and a platform for C++ on the internet.

Initial Support For C++20 Ranges--Casey Carter

Ready to try them?

Initial Support For C++20 Ranges

by Casey Carter

From the article:

We are happy to announce that Visual Studio 2019 version 16.6 contains the first user-visible pieces of C++20 Ranges support. We’ve been working on support machinery for a few releases now, but in this release the tip of the iceberg has finally broken the surface of the water and there are now some tools available for users. The Ranges implementation critically depends on C++ Concepts, and as such is usable with both MSVC and Clang in their C++20 Preview modes but not yet well-supported by IntelliSense. (Don’t worry, we’ll have proper IntelliSense support soon.)...