Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Type Traits Extension by Frederic Bron
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-03-19 04:19:53


Frédéric Bron wrote:
>
>
> Good news for the return type of operators: I have been able to check
> for exact void return and have default "dont_care":
>
> template< class LHS, class RHS=LHS, class RET=dont_care >
> has_operator_plus;
>
> 1. operator+(A, A) exists and returns void
>
> has_operator_plus&lt;A, A&gt;::value -> true (dont check return type)
> has_operator_plus&lt;A, A, void&gt;::value -> true (check for exact void
> return type)
> has_operator_plus&lt;A, A, R&gt;::value -> false (void!=R)
>
> 2. operator+(A, A) exists and returns R!=void
>
> has_operator_plus&lt;A, A&gt;::value -> true (dont check return type)
> has_operator_plus&lt;A, A, void&gt;::value -> false (void!=R)
> has_operator_plus&lt;A, A, R&gt;::value -> true (void!=R)
>
> 3. operaot+(A, A) does not exist
>
> has_operator_plus&lt;A, A&gt;::value -> false
> has_operator_plus&lt;A, A, void&gt;::value -> false
> has_operator_plus&lt;A, A, R&gt;::value -> false
>
> I think this is now much better.
>
>

Could you make the same analysis with "const, volatile and references", as
parameter and return type?

Thanks,
Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/Review-Boost-Type-Traits-Extension-by-Frederic-Bron-tp3380479p3389245.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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