Skip to content

Commit

Permalink
Fixed, CXXGraph::Node::getData() should not be const ZigRazor#438
Browse files Browse the repository at this point in the history
  • Loading branch information
yapa-ymtl committed Aug 5, 2024
1 parent 564a8c0 commit 701ab06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/CXXGraph/Node/Node_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Node {
const CXXGraph::id_t &getId() const;
const std::string &getUserId() const;
const T &getData() const;
T &getData() const;
void setData(T &&new_data);
// operator
bool operator==(const Node<T> &b) const;
Expand Down
7 changes: 6 additions & 1 deletion include/CXXGraph/Node/Node_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ const T &Node<T>::getData() const {
return data;
}

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

template <typename T>
void Node<T>::setData(T &&new_data) {
this->data = std::move(new_data);
Expand Down Expand Up @@ -92,4 +97,4 @@ std::ostream &operator<<(std::ostream &os, const Node<T> &node) {

} // namespace CXXGraph

#endif // __CXXGRAPH_NODE_IMPL_H__
#endif // __CXXGRAPH_NODE_IMPL_H__

0 comments on commit 701ab06

Please sign in to comment.