Boost logo

Boost :

Subject: Re: [boost] [type_traits] has_equal_to< std::vector<T> > always true_
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-10-21 12:34:41


Le 21/10/11 17:38, lcaminiti a écrit :
> Vicente Botet wrote:
>> Hi,
>>
>> I found the same kind of issues while implementing
>> is_constructible/is_assignable/is_convertible for Boost.Conversion. The
>> option I taken was to specialize these traits for the c++
>> implementations that were not using SFINAE. This force of course the
>> user to include the specific file containing the specialization.
>>
> Would the Boost.TypeTraits authors consider adding the specializations* to
> workaround STL not using SFINAE? If not, can these cases be documented?
>
> (*) In this case it'd be nice to name the headers containing the extra
> specialization consistently with other Boost libraries like
> Boost.Conversion-- Vicente, how did you name the headers containing the
> specialization for the STL types?
>
I added all of them in a std directory with the same name as in the
standard. For example

boost/conversion/std/utility.hpp included some specializations for
std::pair,
boost/conversion/std/vector.hpp included some specializations for
std::vector,
...

In this way the user just needs to replace

#include <utility>

by

#include <boost/conversion/std/utility.hpp>

If several libraries use the same convention, it will be quite easy to
provide some files that add some specificities to the standard files in
for example the directory std

boost/std/utility.hpp could include

   #include <boost/type_traits/std/utility.hpp>
   #include <boost/serialization/std/utility.hpp>
   #include <boost/XXXX/std/utility.hpp>
   ....

Best,
Vicente


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