cxxopts icon indicating copy to clipboard operation
cxxopts copied to clipboard

Why have both Value and abstract_value?

Open eyalroz opened this issue 2 years ago • 2 comments

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?

eyalroz avatar Jul 08 '22 21:07 eyalroz

That's a good question. I will take a look at these and see what is going on.

jarro2783 avatar Jul 10 '22 20:07 jarro2783

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.

jarro2783 avatar Jul 11 '22 07:07 jarro2783