"mangesh" <> writes:
> I have a list implementation in which [] operator has been ocerloaded .
> Now when i have pointer to list say *list_ptr , and i write
> list_ptr[0] .
> Which [] operator will be called ?
> Overloaded or default ?
The default, because you have only overloaded [] for type Foo (where
Foo is you list class) and *not* for Foo* (which in fact is impossible
as Foo* is /built-in/ type). To use overloaded [] you have to do:
(*list_ptr)[0].
--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
|