c++,c++11,iterator,forward-list
N4431 - 23.3.5.5/15 list operations [list.ops] (emphasize mine) void remove(const T& value); template <class Predicate> void remove_if(Predicate pred); Effects: Erases all the elements in the list referred by a list iterator i for which the following conditions hold: *i == value, pred(*i) != false. Invalidates only the iterators and references...
c++,list,unique,duplicate-removal,forward-list
No, there's no guarantee that this is well defined. unique is not specified completely enough to guarantee that this is the last time that b is passed to the predicate, so it's possible that the deleted pointer might be used again later. I'm surprised that it works for you, since...
When you call l.assign(10, 5);, there are two viable overloads: void assign(size_type n, const int& val) template <> void assign(int first, int last) When we say that non-template functions are preferred to template functions, that is only true if the two have indistinguishable conversion sequences. But in this case, the...