Get pointer to node in std::list or std::forward_list
问题 I am planning to use std::list in my code, I decided not to use std::forward_list, because for deletions (I figured) the whole list will have to traversed, O(N) complexity for std::forward_list (being a single link list). However, when I looked into the documentation I noticed both the stl containers have O(N) complexity to remove an item. http://www.cplusplus.com/reference/forward_list/forward_list/remove/ http://www.cplusplus.com/reference/list/list/remove/ After some thinking I figured out