catchorg / Clara

A simple to use, composable, command line parser for C++ 11 and beyond
Boost Software License 1.0
648 stars 67 forks source link

Make it possible to bind lambdas when passed by l-value #84

Closed lethal-guitar closed 3 years ago

lethal-guitar commented 5 years ago

Currently, lambdas can only be bound to Opts when passed by r-value. I think it would be nice if lambdas could also be passed by l-value, since it would allow me to separate the parser definition from the logic inside the lambdas. This PR accomplishes that with the help of some SFINAE.

Fixes #58

lethal-guitar commented 5 years ago

I see that there are some build failures, I'll look into it