Boost logo

Boost :

Subject: Re: [boost] [type_traits] has_equal_to< std::vector<T> > always true_
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2012-04-30 00:54:05


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<T, Alloc> > : has_equal_to<T> {};

Halas, it is a bit more complicated because the operator traits have
in fact 3 arguments:
template <class Lhs, class Rhs=Lhs, class Ret=dont_care>
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.

+ update of <boost/detail/container_fwd.hpp>
+ 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.

Frédéric


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