Faking keyword arguments to functions in C++

5 points by raymii


olliej

I was surprised more people had not adopted this strategy - it's functionally how you do it in JS as well, though obviously more concisely in JS as you don't need to explicitly create the struct.

It would be nice if you could do this more cleanly in C/C++ (something like void foo(struct { .... } args) but alas you cannot :(