Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-12-03 17:04:20


"John Maddock" <john_at_[hidden]> writes:

>> Test suite "Type Traits" failed with:
>> 35 assertions out of 36 passed
>> 1 assertion out of 36 failed
>>
>> Test case "type_with_alignment" failed with:
>> 35 assertions out of 36 passed
>> 1 assertion out of 36 failed
>> ====== END OUTPUT ======
>>
>> My question: what gives us the right to expect that is_pod will
>> return true in this case, since is_pod only works with compiler
>> support?
>>
>> Thanks,
>
> Darn, at the time I added that check, it was true I think that
> type_with_alignment always returned a builtin type, so is_pod did detect it
> OK, if that's not the case, shouldn't we specialise is_pod for whatever
> type_with_alignment returns, since it is a postcondition that it returns a
> POD type, or am I being needlessly picky?

It's a nicety, but of course people will know that on most platforms
they can't ever count on is_POD<T>::value being true. Unless there's
built-in support for is_POD it seems to me like the test doesn't tell
us very much. Maybe you should be checking some macro for is_POD
support before doing that test.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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