Your problem is not in the constructor, but in the first call to append() . Since your list is empty begin() equals end() . end() is a valid iterator, but after that it is not. To solve this problem, try calling insert() instead.
Thus, a quick look at <ext/slist> confirms that the slist destructor slist not virtual, which means that slist not intended to be output from.
wilhelmtell
source share