|
|
|
|
|
by gpderetta
1494 days ago
|
|
"Easy" to do if you are willing to put up with macros: https://github.com/gpderetta/libtask/blob/master/tests/q_test.cpp#L160
Note the macro is $, tup is just a C++ function.
It doesn't handle your .bar case, but would be very easy to extend tup to handle initializer lists.(No, I do not use it in production, it is mostly a fun curiosity, but yes, I wish lightweight named tuples were part of the language). |
|