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@lists.isocpp.org>
Gesendet: Mo 20.04.2026 14:25
Betreff: Re: [std-proposals] comparison between pointers and bool
An: std-proposals@lists.isocpp.org;
CC: sasho648 <sasho648@gmail.com>;
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.