C++ Enum Class and Error Codes -- Mathieu Ropert
C++11 gave us enum class and while it’s great to have scoped enums I don’t find it great for error handling. Let’s talk about why.
C++ Enum Class and Error Codes
by Mathieu Ropert
From the article:
Most of my readers, I hope, have been able to use C++11 for a while now (if not hello, I’m sorry the world has changed to become this weird during your 14 years sleep). With it came a small change that allowed for better scoping of names without resorting to weird quirks:
enum class. The idea is simple: owing to C,enumvalues in C++ belong to the class or namespace they are declared in but if we add theclasskeyword to the declaration they know become their own scope instead of leaking to their parent.This was a simple quality of life change in the compiler to address a weakness in the language that folks usually worked around by either adding long prefix to the enum values (C style) or wrapping them within structs or classes (C++98/03 style). And with it came the incentive to migrate C era error code enums to scoped enums. But there’s a catch.

The Budapest C++ Meetup was a great reminder of how strong and curious our local community is. Each talk approached the language from a different angle — Jonathan Müller from the perspective of performance, mine from design and type safety, and Marcell Juhász from security — yet all shared the same core message: understand what C++ gives you and use it wisely.
When working with legacy or rigid codebases, performance bottlenecks can emerge from designs you can’t easily change—like interfaces that force inefficient map access by index. This article explores how a simple
A missing
In this final part of the tuple-iteration mini-series, we move beyond C++20 and C++23 techniques to explore how C++26 finally brings first-class language support for compile-time iteration. With structured binding packs (P1061) and expansion statements (P1306), what once required clever template tricks can now be written in clean, expressive, modern C++.
std::format allows us to format values quickly and safely. Spencer Collyer demonstrates how to provide formatting for a simple user-defined class.
Modern C++ offers elegant abstractions like std::ranges that promise cleaner, more expressive code without sacrificing speed. Yet, as with many abstractions, real-world performance can tell a more nuanced story—one that every engineer should verify through careful benchmarking.