Re: Syntactical issue: should STL list Iterator be overloaded to a pointer to the current element?
Olumide wrote:
:: On 11 Sep, 21:49, Pete Becker <p...@versatilecoding.com> wrote:
::: On 2007-09-11 16:36:01 -0400, "Jim Langston"
::: <tazmas...@rocketmail.com> said:
:::
:::: "Olumide" <50...@web.de> wrote in message
:::: news:1189541795.197604.310750@i38g2000prf.googlegroups.com...
::::: On 11 Sep, 21:11, "Victor Bazarov" <v.Abaza...@comAcast.net>
::::: wrote:
:::::: Better? In what way "better"?
:::
::::: Better as in other than &(*intList_Iterator) .
:::
:::: &(*iterator)
:::: is the common method used to get the address of what iterator
:::: points to. After you see it a few times it no longer looks weird.
:::
::: It looks weird that way. The parentheses aren't needed. <g>
::
:: &*iterator looks mucho weird :-) .
Not really, if you think about it:
*iterator
gives you access to an object, so
&*iterator
is the address of that object.
You will hardly ever have to do this anyway, as in C++ code there is
not much use for a pointer, if you already have an interator.
Probably it is mostly used in interfacing to old C code APIs, which in
C++ looks mucho weirdo anyway.
Bo Persson