Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2003-10-23 20:25:54


Brian McNamara <lorgon_at_[hidden]> wrote:
> I see now where I misunderstood.
>
> On Fri, Oct 24, 2003 at 07:32:51AM +0800, Joel de Guzman wrote:
>> I posed 2 solutions:
>>
>> 1) Have all iterators inherit from a base:
>> (using CRTP: curriously recurring...)
>>
>> template <class I>
>> inline typename mpl::deref<I>::type
>> operator*(iterator_base<I> const&);
>
> Somehow I missed that this (using the base class as a way to narrow the
> overload set) was one of the alternatives you were proposing...
>
>> 2) Have an is_tuple_iterator<I> meta-function
>>
>> template <class I>
>> inline typename lazy_enable_if<
>> is_iterator<T>
>> , mpl::deref<I>
>> >::type
>> operator*(I);
>
> ... and I thought both of your proposed solutions were a variation of
> this (using some version of enable_if). Now that I've gone back and
> re-read the whole thread again, I see what you were/are saying.
>
> I definitely think #2 is the right way to go.
>
> Thanks for clarifying!

Well, I was kinda hoping that you have a trick up your sleeve :->
If you can think of something better, I'm all ears.

Cheers,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk