diff --git a/include/etl/intrusive_forward_list.h b/include/etl/intrusive_forward_list.h index 12e3c3d3..307f110b 100644 --- a/include/etl/intrusive_forward_list.h +++ b/include/etl/intrusive_forward_list.h @@ -1011,6 +1011,29 @@ namespace etl } } + //************************************************************************* + // Removes the element specified by pointer. + //************************************************************************* + void remove(const_pointer element) + { + iterator i_item = begin(); + iterator i_last_item = before_begin(); + + while (i_item != end()) + { + if (&i_item == element) + { + i_item = erase_after(i_last_item); + return; + } + else + { + ++i_item; + ++i_last_item; + } + } + } + //************************************************************************* /// Removes according to a predicate. //*************************************************************************