So if I want to print the list should I take the constant out? Or is it better practice to copy the list and then iterate through it. It seems like this must be a pretty standard problem, so there is probably some normal way of dealing with this.
I am unfamiliar with the term "const member function" but to my knowledge calling begin will not alter the list. It seems silly that you can not use begin on something that is constant.
Yeah, well the reason is because .begin() returns an iterator, and you can modify the iterator, which will directly modify the list. If you declared the iterator of type const_iter (I believe) then you can use const_begin() to get a const_iter that won't let you modify the list, so you can use it on const objects.
It seems strange to me that you can overload functions with a different return value. I know with Java at least you can only overload functions with different parameters. Anyone know how I can invoke the const iteratory instead of the non constant?