Boost logo

Boost :

Subject: Re: [boost] [type_traits] has_equal_to< std::vector<T> > alwaystrue_
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-10-22 13:53:48


El 22/10/2011 12:18, Vicente J. Botet Escriba escribió:
> I'm not sure I understand the standard correctly. The standard says
> container requirements "Requires: T is EqualityComparable".
>
> Does this means that the operator== must not participate in overload
> resolution when the requirements are not meet, or that the compilation
> will fail?
> IMO, it is the first. In other parts of the standard the wording is more
> explicit. For example in the chrono part, every function that has some
> constraints in the template types, state something like:

I don't know if the first option is the correct, and I don't know if
is_default_constructible<std::vector<T>> should be false because T might
not be MoveConstructible.

If it is not guaranteed by the standard, I don't think we should offer
it. Making non-templated functions templated to use SFINAE could not
provoke some unwanted ambiguities?

Ion


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