Yes, that's my thoughts too - and I made the same mistake. I just want to have the line of the error clarified.
Originally Posted by Elysia
It was on the definition line.
Originally Posted by matsp
So would this be one of the cases where you'd want to return a const pointer instead of a pointer to a const object?
Edit: Errr... I meant 'accept', not 'return'.
No, the setNext musn't take a pointer to const (const T*), because you can't demote to non-const w/o a cast (a bad cast).
You can take a const pointer (T* const), sure, but it doesn't really help.