
23 Oct
2007
23 Oct
'07
10:48 a.m.
Hello, in the file mem_algo_common.hpp there is a class basic_multiallocation_iterator (line 50ff). This class contains both definitions for operator* and operator->, where operator* is implemented as: value_type operator*() const { value_type v = (char*)detail::get_pointer(next_alloc_.next_); return v; } and operator->() as: pointer operator->() const { return &operator*(); } The second definition confuses both me and my compiler. Does &operator*() actually mean &(*this)? If yes, wouldn't this mean that operator-> returns the address of a stack allocated result variable, namely the address of the result of operator*? If no, what does this actually mean? Thanks for enlightening me, Markus