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

Opt and Arg classes can be inherited from, but are sliced by default #78

Open vogel opened 5 years ago

vogel commented 5 years ago

I had some special needs from one of my Arg parameter that I wanted to implement by inheriting from it and reimplementing parse method. It turned out to not work, as Arg and Opt instances are sliced in Parser class (see m_options and m_args members).

I think that either Arg and Opt could be make final, or m_options and m_args could use some kind of pointers instead of using values to allow for own implementations of those concepts.