A
Adam Hartshorne
Hi All,
I want to set a pointer to the penultimate element in a std::list, what
is the best way of doing this? Also would setting a pointer to the end
of the list, and then adding another element, also result in a valid
pointer to the then penultimate element of the the list? (i.e. achieving
basically the same thing)
I ask this because I know there is problems with setting pointers with
std::vector then adding elements to the vector. From my experience this
scenario results in an invalid pointer, but I have in my mind that lists
do not suffer the same problem.
Adam
I want to set a pointer to the penultimate element in a std::list, what
is the best way of doing this? Also would setting a pointer to the end
of the list, and then adding another element, also result in a valid
pointer to the then penultimate element of the the list? (i.e. achieving
basically the same thing)
I ask this because I know there is problems with setting pointers with
std::vector then adding elements to the vector. From my experience this
scenario results in an invalid pointer, but I have in my mind that lists
do not suffer the same problem.
Adam