Boost logo

Boost :

From: Ullrich Koethe (koethe_at_[hidden])
Date: 2001-03-29 12:09:59


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 ...
>

I don't see why the result traits shouldn't be part of the algebraic
concept definitions. After all, you always need them together.

> 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
>

Can you give examples where this would be necessary? I've contemplated
this in my application domain, but it looked like an
over-generalization.

Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

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