Skip to content

Commit

Permalink
Add GraphNodeIterator::operator<= required by std::reverse_iterator a…
Browse files Browse the repository at this point in the history
…dapter

This makes possible to build nntrainer in standard library debug mode.
Please see: https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html

Signed-off-by: Piotr Rak <[email protected]>
  • Loading branch information
pwr-sammy committed Mar 7, 2025
1 parent dc7c968 commit 90b98bf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nntrainer/graph/graph_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,19 @@ class GraphNodeIterator {
return lhs.p != rhs.p;
}

/**
* @brief <= comparison operator override
*
* @param lhs iterator lhs
* @param rhs iterator rhs
* @retval true if left is less than or equal to the right value
* @retval false if left is greater than the right value
*/
friend bool operator<=(GraphNodeIterator const &lhs,
GraphNodeIterator const &rhs) {
return lhs.p <= rhs.p;
}

/**
* @brief override for ++ operator
*
Expand Down

0 comments on commit 90b98bf

Please sign in to comment.