C++ Logo

std-proposals

Advanced search

Re: [std-proposals] comparison between pointers and bool

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Mon, 20 Apr 2026 16:54:28 +0200
You could pass named parameters with the function expecting a struct of parameters and using designated intializer lists to name the parameters, e.g.: f( { .elements = f1( { .height = 2 } ), .depthfirst = p } ); -----Ursprüngliche Nachricht----- Von:sasho648 via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Mo 20.04.2026 14:25 Betreff:Re: [std-proposals] comparison between pointers and bool An:std-proposals_at_[hidden]; CC:sasho648 <sasho648_at_[hidden]>; Bump now I had: like: void f(int a, bool d = false); int f1(int a, int *p = nullptr); and I called: int *p; f(f1(2), p); It compiles and runs "fine" - except the behavior is totally unintended. It's evil in my opinion. Obviously I did a mistake putting the second parameter in the first call when I wanted it to be part of the f1 call. It never ever occurred to me until later on when I was checking this part of the code for another thing.

Received on 2026-04-20 14:56:05