Boost logo

Boost :

Subject: Re: [boost] review request: addition to type_traits library of is_less_comparable<T, U> and others
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-12-08 11:54:13


AMDG

Frédéric Bron wrote:
>> Would this also allow a user to override this behavior when they want to
>> ensure an exact type match?
>>
>
> From earlier discussion, we conclude it was not possible to check for
> an exact return type, only convertible to is achievable.
>

It is (almost) possible to check the exact return type.

template<class Expected, class Actual>
boost::is_same<Expected, Actual> test(const Actual&);

Note that this doesn't handle references correctly.

In Christ,
Steven Watanabe


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