Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPL] HAS_XXX gives the wrong answer after "enable_if" on incomplete type in GCC 4.6/7
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2012-12-19 13:48:03


Nathan Crookston wrote:

>
> Duncan Exon Smith wrote:
>
> I'm still interested in whether this is a defect, or just a limitation
>> of C++, if anyone has an opinion...
>>
>
> For what it's worth, I was surprised that has_trait didn't error out when
> passed an incomplete type. It seems like just having it return false with
> incomplete types would be problematic for more than just the incorrect
> deduction -- it could lead to ODR violations, etc.
>
> Perhaps the macros should have a sizeof(T) line added. . .
>

Looking at the implementation, it appears that the decision to return false
in the event of incomplete types is intentional. I found that surprising
-- the documentation doesn't mention that, from what I see.

Nate



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net