
12 Oct
2006
12 Oct
'06
1:07 p.m.
Thorsten Ottosen wrote:
Peter Dimov wrote:
Thorsten Ottosen wrote:
I think the bug is that the compiler does not allow one to take the adress of a temporary object (an rvalue). Normal compilers usually give a warning about it, but compile it.
Such code is ill-formed. No compiler is required to accept it.
Ok.
I guess I can add operator&() for the proxy returned by *iter;
Since your iterator doesn't return a true reference, I don't see what is gained by allowing & on it. Most people that use &*i do that to obtain a real pointer to the element (Container::value_type*), not a Container::pointer. Nobody is quite sure what Container::pointer is supposed to represent; the standard containers use it as an alias for Allocator::pointer.