|
Boost : |
Subject: Re: [boost] [TypeTraits] A patch for clang's intrinsics (was: [type_traits] is_enum on scoped enums doesn't works as expected)
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-09-01 13:39:32
>> OK I'm curious - why would a compiler intrinsic work when used with one
>> std
>> lib, not not when used with another?
>
> Here is the details:
>
> libstdc++ (of gcc-4.2) defines `struct __is_pod` in some header file. To
> deal
> with this, clang disables __is_pod intrinsics when finding `struct
> __is_pod`;
> then, __is_pod is not treated as keyword and it becomes just an
> identifier.
> However, even in this case, old clang sets __has_feature(is_pod) to 1.
> So we cannot rely on `#if __has_feature(is_pod)` to check the availability
> of
> __is_pod intrinsics.
>
> libc++ does not define `struct __is_pod`, so we can safely check
> the availability of __is_pod intrinsics by `#if __has_feature(is_pod)`.
>
>
> Ditto for __is_empty.
Got it, that's just plain nasty isn't it?
Will apply the patch shortly, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk