Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2020-10-03 09:34:44


On 10/3/20 12:30 PM, Andrey Semashev wrote:
> On 10/3/20 11:53 AM, Gero Peterhoff via Boost wrote:
>> Am 12.09.20 um 16:15 schrieb Andrey Semashev via Boost:
>>> Given that Boost.TypeTraits are not equivalent in some instances to
>>> std type traits, I don't think we're going to remove them any time
>>> soon. At least, I would be opposed to such a move.
>>>
>>> You can opportunistically use std type traits and fallback to
>>> Boost.TypeTraits in some simple cases, but that doesn't really make
>>> much sense in Boost since that doesn't remove the dependency on
>>> Boost.TypeTraits and requires workarounds in cases when the type
>>> traits don't match.
>>>
>>> Also, we normally don't include all-in-one headers like
>>> <boost/type_traits.hpp> because that brings way more code than
>>> necessary. This is one of the drawbacks of <type_traits> and one of
>>> the reasons to use Boost.TypeTraits, actually.
>>
>> - Is there an overview/documentation which Boost.TypeTraits differ
>> from the standard?
>
> I haven't seen an overview. But you could read Boost.TypeTraits docs and
> compare it to the standard to see if there is a difference. Some
> differences are not documented, I think, like support for 128-bit
> integers for example.

I should add that in some cases Boost.TypeTraits work around bugs in the
standard type traits, which is also not documented. For example,
std::alignment_of would give incorrect result for 64-bit types on 32-bit
targets and boost::alignment_of works as expected.

>> - Would it make sense to only keep these different/additional
>> Boost.TypeTraits and remove the standard-compliant ones?
>
> IMO, no, because there are C++03 libraries and there are no standard
> type traits in C++03.


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