Why no "w != NULL" assertion before boost/intrusive/rbtree_algorithms.hpp:511 like before the line 476?

5 Aug
2025
5 Aug
'25
8:05 a.m.
Boost version: latest release file: boost/intrusive/rbtree_algorithms.hpp function: rebalance_after_erasure_restore_invariants in this if-branch ``` if(x == x_parent_left){ //x is left child ``` there is "w != NULL" assertion before variable 'w' access: ``` BOOST_INTRUSIVE_INVARIANT_ASSERT(w); if(NodeTraits::get_color(w) == NodeTraits::red()){ ``` but in else-branch there is no same assertion before variable 'w' access: ``` if(NodeTraits::get_color(w) == NodeTraits::red()){ ``` Why? Are there no assertion in else-branch intentionally due to the rbtree structure itself? Thanks.
3
Age (days ago)
3
Last active (days ago)
0 comments
1 participants
participants (1)
-
achinkoff@gmail.com