July 2021

Be Wise, Sanitize - Keeping Your C++ Code Free From Bugs--Marin Peko

All is in the title.

Be Wise, Sanitize - Keeping Your C++ Code Free From Bugs

by Marin Peko

From the article:

For all of the losses it has inflicted, this pandemic has at least made us more conscious about our personal hygiene.

We’re spraying spaces, surfaces and our hands way more often, so why not sanitize our code while we’re at it? After all, software runs the world, and bugs that cause programs to malfunction can cause serious damage – much like their viral counterparts.

If you’re developing in C and C++, you know this all too well. It’s easy to allocate a piece of memory and forget to free it later, or accidentally write past the memory buffer. These issues are extremely hard to find without proper tools and often cause sporadic, sudden crashes.

Using sanitizers as you’re building and testing your program can help you catch a great deal of issues in your source code early on, including memory leaks, buffer overflows and undefined behavior.

Today, we’ll be taking a look at three types of Clang sanitizers, how they’re used and what bugs they can help us nip in the bud.

Let’s spray away!

C++20 three way comparison operator: Part 4--Gajendra Gulgulia

The series continue.

C++20 three way comparison operator: Part 4

by Gajendra Gulgulia

From the article:

In the third part of the tutorial series, I uncovered the mechanics of operator <=> and explained in detail, how the compiler re-writes the comparison expression on a custom object with only operator<=> declared as default and how additionally it can make use of synthesized expression to reverse the operands during expression re-writing process. If you haven’t read the third part, I strongly encourage you to read it before reading this tutorial...

CppCon 2019 Behind the Scenes of a C++ Build System--Jussi Pakkanen

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Behind the Scenes of a C++ Build System

by Jussi Pakkanen

Summary of the talk:

Everyone has an opinion on what build systems should do but there are surprisingly few who have an understanding of how they do it. In this talk we shall look behind the curtain and examine what does it actually take to create a modern build system and how they go about their business of turning source code into either compiler errors or executables.

On this journey we shall learn about the wonders of supporting 10+ different platforms and toolchains, dependency management, the awesomeness (both ironically and not) of shared libraries, compiler bugs and the interesting requirements on tools used at the lowest layers of a modern operating system. Using the increasingly popular Meson build system we shall examine real world design choices and tradeoffs and how they affect the final end user development experience. Performance optimization is also examined by looking at how you can efficiently scale program compilation both up to a compilation cluster and down to something like a Raspberry Pi.

Armed with all this knowledge we should finally be able to answer the question of why almost all build systems have suffered from poor usability and maybe, just maybe, find a proper solution for the build and dependency problem.

Slides of the 24th of June 2021 BeCPP Meeting -- Marc Gregoire

On June 24th, 2021, the Belgian C++ Users Group had their next online event. The slides and other material are now available online.

Slides of the 24th of June 2021 BeCPP Meeting

by Marc Gregoire

About the event:

  • “A new way of formatting in C++20, are we getting there in the end?” by Lieven de Cock
  • “Understanding value categories in C++” by Kris van Rens

If you couldn't attend the event in person, or if you would like to go over the material again, you can download them from the BeCPP website.

CppCon 2020 Effective Remote C++ Development with Codespaces--Nick Uhlenhuth

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Effective Remote C++ Development with Codespaces

by Nick Uhlenhuth

Summary of the talk:

The rise of remote work and the growth of team sizes present a challenge for C++ developers. Many C++ projects have complex hardware and software requirements, making onboarding of new team members and productive coding from home harder than they need to be. We need tools to ease configuration of your team's development environments and grant them access to the processing power they need from wherever they are in the world.

This presentation will show how Codespaces can use the power and flexibility of the cloud to address these issues. Codespaces give you the ability to quickly create a managed online development environment specific to your project that you can access from anywhere. We'll look at the problems which hit C++ developers particularly hard, like long build times and dependency management. Finally, we'll show the tool in action to give you a feel for how your teams could leverage it, and more broadly get you to think about what parts of your team's development process can be streamlined.

New Software Design Track at CppCon 2021

Will you attend?

New Software Design Track at CppCon 2021

From the article:

CppCon 2021 introduces a new Software Design Track.
Lisa LippincottEvery year CppCon presents dozens of sessions on how to produce high quality C++ code. But high quality software products require more of software engineers than just good coding. Great software products are built by engineers with great design skills, so CppCon also presents sessions focused on designing software components of high quality...

C++20 three-way comparison operator: Part 3--Gajendra Gulgulia

The series continue.

C++20 three-way comparison operator: Part 3

by Gajendra Gulgulia

From the article:

In the second part of the tutorial series, I touched upon the rules of the default operator<=> . Unlike default constructors or destructors, the default version of the <=> is not available automatically but has to be declared in the interface of the class and then only it is available to be used.
In this part of the tutorial series, I’ll explain the mechanics of the default operator<=> to further elucidate the rules of the three-way operator, i.e. what exactly is the compiler doing when it sees an expression a < b on a custom object for which no comparison operator is overloaded but only a default version of the operator<=> is declared...