Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__