cxxopts
cxxopts copied to clipboard
Why have both Value and abstract_value?
Value
and abstract_value
are both abstract base classes which can't be instantiated, with the latter inheriting the former. But - what's the use in even having a Value
class, if abstract_value
is its only inheritor? Can't we just fold the latter into the former?
That's a good question. I will take a look at these and see what is going on.
I think the only reason for abstract_value
is so that standard_value
can be specialised on bool
, which sets the default values correctly for a bool.
I'm thinking that the other way to do it would be to instantiate some initialiser based on T
and then abstract_value
just becomes the standard_value
.