Skip to content

Commit

Permalink
Update c++/cavl.hpp
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Kirienko <[email protected]>
  • Loading branch information
serges147 and pavel-kirienko authored Aug 24, 2024
1 parent 5d76981 commit 2579460
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions c++/cavl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,15 +790,16 @@ class Tree final // NOSONAR cpp:S3624
return NodeType::template search<Pre, Fac>(origin_node_, predicate, factory);
}

/// The function has no effect if the node pointer is `nullptr`, or node is not in the tree (aka unlinked).
/// It is safe to pass the result of search() directly as the `node` argument:
/// `tree.remove(Node<T>::search(root, search_predicate));`
/// The function has no effect if the node pointer is nullptr, or node is not in the tree (aka unlinked).
/// It is safe to pass the result of search() directly as the node argument:
///
/// tree.remove(Node<T>::search(root, search_predicate));
///
/// but it could be done also by direct node removal:
/// ```
///
/// if (auto* const node = Node<T>::search(root, search_predicate) {
/// node->remove();
/// }
/// ```
///
/// Wraps NodeType<>::remove().
///
Expand Down

0 comments on commit 2579460

Please sign in to comment.