User-Defined Deduction Guides for Class Templates in C++

User-Defined Deduction Guides for Class Templates in C++

I remember when I first got serious about modern C++. It was in 2017, my company was starting a new project from scratch, and we chose the latest standard: C++17, which had just been released. Diving into all the modern features of C++, I remember one feature that left me particularly puzzled: user-defined deduction guides. They are used to influence CTAD (Class Template Argument Deduction), which was a major feature of C++17. I was puzzled because I couldn’t understand why anyone would ever need to write such a guide by hand…

[Read more...]

How to Fix “Low Disk Space on /boot” on Linux

One day, you power up your computer, wait for Linux to boot, log in… and this message pops up:

low space disk on boot

You might decide to ignore it, or you might think this is an issue worth looking into. And you’d be right!

However, clicking “Examine” doesn’t really tell you how to fix the issue. It “just” shows you the disk usage analysis of the /boot partition:

disk usage analyzer before cleanup

[Read more...]

clang-tidy, const & (N)RVO

Almost one year ago, clang-tidy threw an unexpected and unfamiliar message in my face: warning: constness of 'str' prevents automatic move [performance-no-automatic-move] (documented here). The incriminated code looked something like this:

auto build_path(const std::string& basedir, int index) {
	const auto str = fmt::format("{}/output/{}", basedir, index);
	
	fmt::print("{}\n", str);
	// ... do some work with 'str'...
	
	return str; // <-- the warning was here
}

I didn’t have time to investigate, so I wrote down a note, swore I would look into it later, and just forgot… Until today. I thought it would be simple. It was not. Because, as always, C++ is full of surprises.

[Read more...]

Manually Install WiFi Drivers on Linux

Manually Install WiFi Drivers on Linux

On December 24th, 2024, Debian had a gift for me: it installed Linux kernel 6.11.10, and suddenly the WiFi module of my laptop stopped working. I quickly found a workaround (selecting an older kernel with GRUB during boot) and hoped that the problem would be fixed by the next kernel update or by a firmware update from my laptop’s manufacturer. Sadly, kernel 6.12 arrived and nothing changed. I finally took some time to really investigate the issue.

[Read more...]

Resizing Partitions on Linux

Sometimes, you need to resize your partitions on Linux. And this may not be as easy as you think…

When I installed Debian on my work computer a few months ago, the wizard suggested creating 2 separate partitions: one for root (with the OS itself), another for home (with my personal data). Alas! The suggested sizes (that I naively accepted) were highly unsuitable and a month later, the root partition (only 40 Go) was full. I had to resize them. It turns out that now, 5 months later, the home is full (I really generate a lot of data for my current project). It’s time to resize my partitions again but this time I will keep track of the entire procedure in this article. Who knows when I will have to resize them one more time…

[Read more...]