3 ms·
If only named member initializers were supported in C++. Here's a similar hack that works in C++11, though it unfortunately requires declaring a global variabl
by kentonv 12y ago
If only named member initializers were supported in C++.
Here's a similar hack that works in C++11, though it unfortunately requires declaring a global variable for each name (which I make less-bad by prefixing them with $, which is non-standard but supported by all major compilers):
https://gist.github.com/kentonv/7553792 https://gist.github.com/kentonv/7553792
- captaincrowbar 12y agoI did something similar (without macros, with a bit more type safety since the keywords have an associated type, and with a shortcut for boolean arguments): https://github.com/CaptainCrowbar/kwargs https://github.com/CaptainCrowbar/kwargs