Boost logo

Boost :

Subject: Re: [boost] review request: addition to type_traits library of is_less_comparable<T, U> and others
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2009-12-09 02:18:46


>>> It is (almost) possible to check the exact return type.
>>>
>>> template<class Expected, class Actual>
>>> boost::is_same<Expected, Actual> test(const Actual&);
>>>
>>
>> Does not work with void return operator:
>>
>
> Of course it doesn't work as is.  It would have to be
> added as an additional check after you already know
> that the return type is non-void.

But what do we really want? (i) check for convertible to something
(default bool) or (ii) check for exact return type?
For sure we need (i). Do we need (ii) and if yes, it would have to be
another traits?

Frédéric


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