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

CXXGraph::Node::getData() should not be const #438

Open
nolankramer opened this issue May 13, 2024 · 2 comments · May be fixed by #462
Open

CXXGraph::Node::getData() should not be const #438

nolankramer opened this issue May 13, 2024 · 2 comments · May be fixed by #462
Labels
core something about core enhancement New feature or request good first issue Good for newcomers Priority:Medium Priority Label for medium priority issue

Comments

@nolankramer
Copy link
Collaborator

The current function signature of CXXGraph::Node::getData() is:

template <typename T>
const T &Node<T>::getData() const {
  return data;
}

This prevents users from modifying their stored data without const_cast. We should remove the qualifiers from this function. If the user wants read-only data, they should make the entire graph const.

@ZigRazor
Copy link
Owner

Maybe is better to duplicate the function, one with const on return value and on object, and one non-const function

@ZigRazor ZigRazor added enhancement New feature or request good first issue Good for newcomers Priority:Medium Priority Label for medium priority issue core something about core labels May 14, 2024
@yapa-ymtl
Copy link

Hi, Can I work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core something about core enhancement New feature or request good first issue Good for newcomers Priority:Medium Priority Label for medium priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants