
On Wed, Apr 17, 2019 at 7:42 AM Andrzej Krzemienski via Boost < boost@lists.boost.org> wrote:
Some implementations of std::list throw from their move constructors and default constructors. I understand that the implementation is easier if even an empty list has a dummy node, which requires allocation.
While the authors can certainly chime in (some lurk here sometimes) I have never heard them make the argument that it is about ease of implementation. If the nodes are in the heap, end iterators are preserved when swapping or moving (as they are for vector). I also vaguely remember something about fancy pointers and sentinel nodes, but I don't know fancy pointers. -- Nevin ":-)" Liber <mailto:nevin@cplusplusguy.com <nevin@eviloverlord.com>> +1-847-691-1404