Re: Can Objects has multiple classes?
- From: Ryan McDougall <NQG24419 nifty com>
- To: John Cupitt <jcupitt gmail com>, gtk-devel-list gnome org
- Cc:
- Subject: Re: Can Objects has multiple classes?
- Date: Thu, 05 Aug 2004 19:29:31 +0900
On Thu, 2004-05-08 at 10:05 +0000, John Cupitt wrote:
> I'd subclass I think, probably less painful in the long run. If you do
> something even a bit wierd it'll be that much harder to understand
> when you caome back in 6 months time.
>
> MyIterator
> MyFwdIterator extends MyIterator
> MyBackIterator extends MyIterator
>
Thank you for your reply John. Just to be clear, I *have* considered the
obvious methods, such as sub-classing. Currently the code overhead is
*way* too prohibitive since I have to implement something like
reverse_const_forward_list_iter extends reverse_iter and const_iter
extends ... bleh
Which is easy in C++, but way too much code in C. Similarly what I'm
asking to do isn't necessary in C++ since it has so many other ways to
get the behaviour I want.
Currently the best solution is to special case reverse iterators with
if-thens, and do some const-cast hacking for const iterators, but that
isn't extensible to other iterator traits or adaptations.
Cheers,
Ryan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]