Boost logo

Boost :

Subject: Re: [boost] [guidelines] why template errors suck
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-09-28 13:29:15


On Tue, 28 Sep 2010, David Abrahams wrote:

> At Tue, 28 Sep 2010 11:21:55 -0400 (EDT),
> Jeremiah Willcock wrote:
>>
>>> is_convertible<decltype(f != l), bool>::value
>>> is_convertible<decltype(p(*f)), bool>::value
>>
>> These can be written as "normal" valid expressions:
>>
>> bool(f != l)
>> bool(p(*f))
>
> Isn't bool(x) equivalent to (bool)x? I think that's valid code for
> any x.

Yes. My comment there was just that you did not need decltype and
is_convertible to write those two constraints -- a standard cast would
work.

-- Jeremiah Willcock


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