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

Const correctness #21

Open
Yelnats321 opened this issue Oct 3, 2017 · 0 comments
Open

Const correctness #21

Yelnats321 opened this issue Oct 3, 2017 · 0 comments

Comments

@Yelnats321
Copy link
Owner

Currently entities employ reference semantics rather than value semantics, which is the less intuitive of the two. This means that passing in a const entity to a function does not guarantee that the entity won't be modified (since you can just copy it into a non const entity and modify it there).

There are other problems like sync() not being able to be called from a const entity and other little things that just feel off.

The options going forward are either to keep things as is or to split entity into two classes, a const entity and a non-const one, where the manager will return one or the other based on context. Probably the best approach to this but might feel unintuitive and hard to follow.

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

1 participant