Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-03-29 13:27:22

Jeremy Siek wrote:
> I agree, we certainly do need result type traits, however
> I think the requirements on the result type produced should
> remain what I've stated, convertible to X and models ...
> To allow for expression templates, the result type will not
> only depend on the operands but also on the operator.
> Therefore we need a tag for each operator.
> struct add_tag { };
> struct multiply_tag { };
> ...
> and then make the operator tag a parameter to the traits class
> result_traits<OpTag,A,B>::type
> For builtin types, the result_traits can dispatch to the simpler
> promotion traits class that does not care about the operator.

..for example to the 'boost::arithmetic_conversions_traits<>' class template
(see thread and


Boost list run by bdawes at, gregod at, cpdaniel at, john at