Boost logo

Boost :

Subject: Re: [boost] [chrono] type_traits/common_type and integer/ratio
From: Vicente Botet Escriba (vicente.botet_at_[hidden])
Date: 2009-12-03 17:00:55


John Maddock wrote:
>
>> Typeof works, but I'm wondering if it's overkill and that perhaps
>> common_type is much more lightweight and appropriate. promote_args
>> doesn't do quite what I need here, but thank you for pointing that
>> facility out to me.
>
> The only version of common_type I've seen uses typeof internally, so
> doesn't
> actually differ from your existing implementation - other than having a
> cute
> interface.
>
> Just my 2c, John.
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
>

Hi,

IMO the typeof of X() * X() + Y() * Y() use the declarations of the
operators * and +. These operator could need common_type if the operators *
and + are able to combine different types. Thus the uses of typeof and
comon_type are orthogonal.

Best,
Vicente

-- 
View this message in context: http://old.nabble.com/-chrono--type_traits-common_type-and-integer-ratio-tp26555530p26633981.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