Closed jh3141 closed 7 years ago
It would certainly be useful - and is something I've been intending to do.
Clara primarily targets C++03 as a base, so anything C++11/14/17 related needs to be properly guarded. I've just ported over the compiler toggle mechanism from Catch as a step towards making this easier.
I'll looking at adding std::function
soon.
One question I'm still struggling with, myself, is: should the std::function take only the argument value? Or should it take the config object as well? Both options seen useful in their own way, so I'd probably provide both.
The new version of Clara has been rewritten as a C++11 library and works natively with lambdas now.
The above would be very helpful, as it would allow C++11 lambda functions and/or the results of
std::bind
to be used as option handlers, rather than just member or free functions, which as far as I see are the only options at present.