C++26: A User-Friendly assert() macro

C++26 is bringing some long-overdue changes to assert(). But why are those changes needed? And when do we actually use assert, anyway? At its core, assert() exists to validate runtime conditions. If the given expression evaluates to false, the program aborts. I’m almost certain you’ve used it before — at work, in personal projects, or at the very least in examples and code snippets. So what’s the problem? The macro nobody treats like a macro assert() is a macro — and a slightly sneaky one at that. Its name is written in lowercase, so it doesn’t follow the usual SCREAMING_SNAKE_CASE convention we associate with macros. There’s a good chance you’ve been using it for years without ever thinking about its macro nature. Macros, of course, aren’t particularly popular among modern C++ developers. But the issue here isn’t the usual - but valid - “macros are evil” argument. The real problem is more specific: The preprocessor only understands parentheses for grouping. It does not understand other C++ syntax such as template angle brackets or brace-initialization. As a result, several otherwise perfectly valid-looking assertions fail to compile: 1 2 3 4 5 6 7 // https://godbolt.org/z/9sqM7PvWh using Int = int; int x = 1, y = 2; assert(std::is_same<int, Int>::value); assert([x, y]() { return x < y; }() == 1); assert(std::vector<int>{1, 2, 3}.size() == 3); Each of these breaks for essentially the same reason: the macro argument parsing gets confused by commas or braces that aren’t wrapped in an extra pair of parentheses. You can fix each of them, of course, by adding an extra pair of parentheses. For example the last assertion would become assert((std::vector<int>{1, 2, 3}.size() == 3)); - you can play with the examples here. But let’s be honest: this is ugly, easy to forget, and not exactly beginner-friendly. Sure, after hitting the problem once or twice, most people internalize the workaround — just like with the most vexing parse. Still, it’s unnecessary friction for such a fundamental utility. P2264R7: Making assert less fragile This is where Peter Sommerlad’s proposal, P2264R7, comes in. The proposal fixes the assert macro by redefining it as a variadic macro using __VA_ARGS__. Instead of accepting a single parenthesized expression, assert now takes (...) as its parameter. That small change makes all the previously broken examples just work — no extra parentheses required. What about diagnostic messages? Originally, the proposal allowed users to attach diagnostic text via the comma operator, similar to static_assert. That idea didn’t survive the review phase. Instead, there is a mechanism to prevent the use of the comma operator on a top level, so you cannot accidentally create always true assertions like this: 1 assert(x > 0 , "x was not greater than zero"); Something that you could very easily create from an existing static_assert. So if we want to have some diagnostics, we still have to use the && operator instead: 1 assert(x > 0 && "x was not greater than zero"); This keeps the semantics clear and avoids subtle bugs. But aren’t contracts coming? One common objection addressed in the proposal is the claim that assert is obsolete in a future with contracts. Contracts will be great. But they won’t make assert disappear overnight. Just as concepts didn’t eliminate SFINAE or older template techniques — they simply gave us better tools — contracts won’t erase assert either. Assertions will continue to exist in real-world codebases, whether directly or wrapped inside higher-level precondition utilities. Improving assert is still valuable, especially when the changes are small, simple, and easy to backport. If you’re curious, the paper discusses several other potential concerns in detail; you can find them in the section on potential liabilities of the proposed change. Compatibility and availability Importantly, this change does not break existing code. All previously valid usage patterns remain valid — the proposal merely enables new, less fragile ones. At the time of writing, (February 2026), none of the major compilers support this feature yet. As with many C++26 improvements, it will take some time before it becomes widely available. Conclusion The C++26 update to assert() is a great example of incremental language evolution done right. It doesn’t reinvent assertions, replace them with something flashier, or force new programming models on existing code. Instead, it quietly removes a long-standing sharp edge. By making assert variadic, the language eliminates a class of surprising compilation failures, improves readability, and reduces the cognitive overhead of using a tool that every C++ developer relies on. It’s a small change — but one that makes everyday C++ just a little bit nicer to work with. Sometimes, that’s exactly the kind of progress we need. Connect deeper If you liked this article, please hit on the like button, subscribe to my newsletter and let’s connect on Twitter!

Sandor Dargo’s Blog
SimpleX Chat: because nothing screams "user-friendly" like navigating a labyrinth of jargon to chat without an ID. 🙄🔒 It's like they designed a messenger app on hard mode for people who don't want to communicate. 🗣️🚫
https://simplex.chat/ #SimpleXChat #UserFriendly #Communication #JargonLabyrinth #MessengerApp #HackerNews #ngated
SimpleX Chat: private and secure messenger without any user IDs (not even random)

SimpleX Chat - a private and encrypted messenger without any user IDs (not even random ones)! Make a private connection via link / QR code to send messages and make calls.

How to install WordPress from Plesk

Read more 👉 https://lttr.ai/ApQo3

#CreatingWebsites #UserFriendly #Install

How to Install WordPress - Websavers

WordPress is by far the most popular software for creating websites, whether you wish to create your own WordPress site or have someone develop a WordPress site for you. It is user friendly, has a ton of functionality, is endlessly extensible (meaning you can install plugins to add just about anything…

Websavers
👩‍💻 Oh, look! Another #macOS tool that promises to automate your life with the beloved simplicity of Lua scripting. Because nothing screams "user-friendly" like diving into the arcane depths of #GitHub to wrangle a staggering amount of code just to avoid clicking a few buttons. 🛠️✨
https://github.com/Hammerspoon/hammerspoon #LuaAutomation #UserFriendly #Tools #TechHumor #HackerNews #ngated

🔄 YouTube aggiorna: ora ricorda le preferenze di ordinamento! Semplificazioni alla tua esperienza di visualizzazione. #YouTubeUpdates #UserFriendly

🔗 https://www.tomshw.it/hardware/novita-youtube-memorizza-lordinamento-scelto-2026-03-12

YouTube ora ricorda le preferenze di ordinamento

La piattaforma mantiene ora l’ordinamento scelto nella scheda Video anche dopo aver aperto un contenuto e usato il tasto indietro del browser.

Tom's Hardware

@kkarhan @GrapheneOS @tails_live @torproject @signalapp

"GrapheneOS chose their requirements and they can happily design their own platform instead."

There's no need to reinvent the wheel. AOSP is a secure, open-source platform that has been around for almost 20 years. I don't want to debate rumors that Google wants to make AOSP proprietary because there is no evidence to support this, especially since it would not benefit them in any way.

"I just think that their stubbornness"

It's not stubborness and I explained why.

"They are the antithesis to #Tails when it comes to #UserFriendly-ness and approachability for #Normies and #TechIlliterates

It's probably the first time I've seen “Tails” and “Normie” in the same sentence, It's not that Tails is difficult to use, but I'm really not sure that many “normies” use it or even know it exists. The user experience on GrapheneOS is almost identical to Pixel OS, the standard operating system for Google Pixel devices, so using GrapheneOS is likely to seem much simpler and familiar to normies, as they will already be used to it.

"Espechally since the problems woth #MobilePhones and the underlying technology ain't fixable with an #AndroidROM

GrapheneOS is not a ROM, Pixel OS is not a ROM, and LineageOS is not a ROM either, theses operating systems are not ROMs.

"Instead we need to foster a #SecurityCulture and proper #ITsec, #InfoSec, #OpSec & #comsec

Indeed, and what GrapheneOS does about security is completely appropriate, including informing people and giving them good advice.

"Otherwise we'll see them fail the same way @signalapp did, which is eitger getting shut down (#EncroChat-style) or being uncovered as a controlled opposition / honeypot (like #ANØM aka. #OperationIronside aka. #OperationTrøjanShield)…"

Signal did not fail, and mentioning Encrochat, ANON, and honeypots in the same sentence is irrelevant. These things have absolutely nothing in common with Signal, you seem to be believing made-up stories.

@Xtreix well, @GrapheneOS chose their requirements and they can happily design their own platform instead.

  • I just think that their stubbornness makes them look like Stallmanist extremists to the point of being unbearable cringe and completely loosing the plot.

To the point that it's cheaper to go black/red and teach that to people, even at the risk of inconvenience.

  • I mean, in many juristictions one will have to do so anyway, but that's not tue point here…

I think #GrapheneOS prefer to "die on their hill" of "moral superiority" than fave the reality that 99% of people can't and won't blow $500 - $1000+ on a phone when any half-decent Netbook with @tails_live , @torproject and #4G or #5G modem can do the same.

Otherwise we'll see them fail the same way @signalapp did, which is eitger getting shut down (#EncroChat-style) or being uncovered as a controlled opposition / honeypot (like #ANØM aka. #OperationIronside aka. #OperationTrøjanShield)…

Red/black concept - Wikipedia

1/3: 🧵 You'd like to trawl the #DOJ's latest release of the #EpsteinFiles & help make sense of the million of data points that map out normalised #evil amongst #rulingclasses but don't have a data analyst profile?
Just dive into #Jmail, the #userfriendly way of navigating the files with a #GoogleSuite look&feel incl. Gmail, Drive, Amazon purchases, photos and flights.
Genius brain child of Riley Walz & Luke Igel.

https://www.jmail.world

Jmail, logged in as [email protected]

You are logged into [email protected], Jeffrey Epstein's email. Sourced from the November 2025 House Oversight Committee data release.

Jmail

AI agents could change your life — if they don’t ruin it first

https://fed.brid.gy/r/https://www.vox.com/technology/477977/chatgpt-claude-code-moltbook-ai-agent

@Bjoerne Ich sehe Dust Puppy. Ich folge.
#userfriendly