Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-03-05 14:22:20

From: "Richard Peters" <r.a.peters_at_[hidden]>
> From: "Rob Stewart" <stewart_at_[hidden]>
> >
> > PMFJI, but I wonder whether this would work:
> PMFJI... I have no clue what it means, sorry.

Pardon Me For Jumping In

> > template <typename T, typename U>
> > void f(T a, U b)
> > {
> > typedef typename <magical_incantation<T, U>::type V;
> > f_impl<V>(a, b);
> > }
> >
> > a and b can have different types, but then magical_incantation
> > computes a common type to which both can be converted and the
> > implementation function can be invoked with that type.
> >
> > I may be off base, and you may have already tried this approach,
> > but I just wanted to mention it if it could help.
> Oh, there are a few ways in which you can perform computations with the
> expression templates, but that was not what I meant. My point was: If you
> specify the result of operators + and - to be big_integer, then expression
> templates cannot be made to work, because then those operators return types
> other than big_integer. User code may depend on the specification that those
> operators do return big_integers. Therefore, any implementation satisfying
> the requirements of the C++ standard library proposal will miss the possible
> speedincrease gained by the use of expression templates.

Oh, sorry. I missed your point.

Rob Stewart                           stewart_at_[hidden]
Software Engineer           
Susquehanna International Group, LLP  using std::disclaimer;

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