Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why have both Value and abstract_value? #348

Open
eyalroz opened this issue Jul 8, 2022 · 2 comments
Open

Why have both Value and abstract_value? #348

eyalroz opened this issue Jul 8, 2022 · 2 comments

Comments

@eyalroz
Copy link
Contributor

eyalroz commented Jul 8, 2022

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?

@jarro2783
Copy link
Owner

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

@jarro2783
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants