-
Notifications
You must be signed in to change notification settings - Fork 117
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
Fixed, CXXGraph::Node::getData() should not be const #438 #462
base: master
Are you sure you want to change the base?
Conversation
the code does not compile... please check it |
Thanks , I am checking that |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #462 +/- ##
=======================================
Coverage 97.87% 97.87%
=======================================
Files 87 87
Lines 10079 10081 +2
Branches 670 670
=======================================
+ Hits 9865 9867 +2
Misses 214 214
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The workflow of build and test does not work in any platform( only windows fails in general ), but for ubuntu and macos the workflow should compile and test the library. |
include/CXXGraph/Node/Node_decl.h
Outdated
@@ -48,6 +48,7 @@ class Node { | |||
const CXXGraph::id_t &getId() const; | |||
const std::string &getUserId() const; | |||
const T &getData() const; | |||
T &getData() ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the extra space before the semicolon. And the & should be next to T. Additionally, the function can be marked const
(however the type returned should not be const T&
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. T& getData() const;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not possible, We cannot overload a function based on return type.
include/CXXGraph/Node/Node_impl.hpp
Outdated
@@ -65,6 +65,11 @@ const T &Node<T>::getData() const { | |||
return data; | |||
} | |||
|
|||
template <typename T> | |||
T &Node<T>::getData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - the &
should be next to the T
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update
@ZigRazor It seems the tests are failing for reasons unrelated to the code. |
Fixed lint issue
Hi @ZigRazor
This PR related to "CXXGraph::Node::getData() should not be const" issue with #438.