Boost logo

Boost :

From: Fredrik Blomqvist (fredrik_blomqvist_at_[hidden])
Date: 2005-04-19 18:04:39

Pavel Vozenilek wrote:
> "Fredrik Blomqvist" wrote:
>> I was browsing the docs for the upcoming circular_buffer component
>> and noticed that the declaration of the comparison operators use the
>> following, "traditional" style.
>> template <class T, class Alloc>
>> bool operator< (const circular_buffer<T,Alloc>& lhs, const
>> circular_buffer<T,Alloc>& rhs);
>> I think they should be templatized on both the lhs And rhs, like so:
>> template <class T0, class Alloc0, class T1, class Alloc1>
>> bool operator< (const circular_buffer<T0,Alloc0>& lhs, const
>> circular_buffer<T1,Alloc1>& rhs);
>> Not earth-shattering perhaps, but still a nice flexibility
>> improvement IMHO. This scheme is used by
>> several other boost components like for ex multi-index.
> I remember this was suggested during review but perhaps
> an common consensus on this should be formed first.
Yes that makes sense. Personally I see mostly benefits and I think it's
nice to allow the contained elements to decide on compatibility.
A good example could be the Iterator facade.

// Fredrik Blomqvist

Boost list run by bdawes at, gregod at, cpdaniel at, john at