Boost logo

Boost :

Subject: Re: [boost] SFINAE yes_type and no_type
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-04-16 06:23:00


On 16/04/2011 12:11, Robert Jones wrote:
> On Fri, Apr 15, 2011 at 4:13 PM, Jeroen Habraken<vexocide_at_[hidden]> wrote:
>
>> Hi,
>>
>> Is there a specific yes_type and no_type inside boost that I should be
>> using when writing a SFINAE test? There seem to be quite a few defined
>> already and reinventing the wheel (albeit it being trivial) again
>> doesn't make sense.
>>
>>
> There's true and false types, would that do? Yes/no is generally less clear
> than
> true/false as the phrasing of the resulting function identifier tends to be
> less crisp.
>
> if ( doesItWork( )== yes )....
>
> vs
>
> if ( itWorks( ) )....

They need to be differently sized types so that you can use sizeof to
distinguish which function overloads gets picked up.


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