Boost logo

Boost :

Subject: Re: [boost] [type_traits] has_equal_to< std::vector<T> > always true_
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-04-30 21:08:19

Frédéric Bron wrote
> Hi Lorenzo,
>> 1) I'd add something like this for each STL container that defines an
>> operator==:
>>    template< typename T, class Alloc = std::allocator<T> >
>>    struct has_equal_to< std::vector&lt;T, Alloc&gt; > : has_equal_to<T>
>> {};
> Halas, it is a bit more complicated because the operator traits have
> in fact 3 arguments:
> template &lt;class Lhs, class Rhs=Lhs, class Ret=dont_care&gt;
> struct has_equal_to : public true_type-or-false_type {};
> So we have to deal with left hand side and right hand side case + return
> type.
> For Lhs and Rhs arguments, it is easy because we just have to deal with
> Lhs=Rhs.
> It is a bit more tricky with the return type.
> We also have to deal with const volatile and references.

Yes, I understand (the evil is in the details ;) ). At some point I might
had some decent specialization code at least for has_equal_to within
Boost.Contract. I'll take a look, otherwise I can implement something and
run it by this ML.

> + update of &lt;boost/detail/container_fwd.hpp&gt;

We can do separate headers <boost/type_traits/std/vector.hpp>, etc if the
above doesn't work.

> + detailed testing.
> I fear this is too much for 1.50 but we may plan for 1.51? It would be
> a good idea to have this working.

Yes, plus I don't have much time now... I wanted to know that there's
agreement in fixing this so if I spend time fixing it won't be lost. I'll
see what I can do for 1.50, if not then we'll try for 1.51.


View this message in context:
Sent from the Boost - Dev mailing list archive at

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