- Insert(it.m_node, (const_base_reference)v); \
- return iterator(it.m_node->GetPrevious(), GetLast()); \
+ if ( it == end() ) \
+ { \
+ Append((const_base_reference)v); \
+ /* \
+ note that this is the new end(), the old one was \
+ invalidated by the Append() call, and this is why we \
+ can't use the same code as in the normal case below \
+ */ \
+ iterator itins(end()); \
+ return --itins; \
+ } \
+ else \
+ { \
+ Insert(it.m_node, (const_base_reference)v); \
+ iterator itins(it); \
+ return --itins; \
+ } \