From -7606464368781287659 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,66d20309909372f6 X-Google-Attributes: gidf78e5,public From: Valentin Bonnard Subject: Re: STL and set_union algorithm question? (newbie to STL!) Date: 1998/04/18 Message-ID: <3537FC12.360B@pratique.fr>#1/1 X-Deja-AN: 346369709 Content-Transfer-Encoding: 7bit Approved: stephen.clamage@sun.com (comp.std.c++) References: <35376387.41C6@wizard.net> Mime-Version: 1.0 Reply-To: bonnardv@pratique.fr Originator: clamage@taumet X-NNTP-Posting-Host: cyber46-9.paris.imaginet.fr To: James Kuyper Content-Type: text/plain; charset=us-ascii Organization: Ecole Normale Superieure, Paris, France Newsgroups: comp.std.c++ James Kuyper writes: > If you override mutable_set_iterator::operator*() to return *this, then > how do you do the following: > > void func(mutable_set_iterator i) > { > (*i)->member_function(); > } > > You could make this work by defining set::iterator to be a > mutable_set_iterator derived from T. However, when T is a class type > such as 'long' or 'MyClass *', you cannot derive from it. You could define mutable_set_iterator::operator T(). But as no conversion will be done for (*i).member and operator. can't be overloaded, this isn't very good. I have never said that it was a good idea to create mutable_set_iterator. -- Valentin Bonnard mailto:bonnardv@pratique.fr info about C++/a propos du C++: http://pages.pratique.fr/~bonnardv/ [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]