
4 Jul
2004
4 Jul
'04
2:08 a.m.
"Doug Gregor" <dgregor@cs.indiana.edu> wrote Ok I'm onto this and agree it looks rather cool.... template<typename T> struct MyUDT; template<typename Op,typename Ta, typename Tb> struct result_of<Op(MyUDT<Ta>,MyUDT<Tb>) >{ typedef MyUDT< typename result_of<Op(Ta,Tb)>::type > type; }; int main() { result_of< minus(int,double) >::type x; } --------
If we had "smarter" versions of std::plus, std::minus, etc. that played well with result_of, I think that would solve the issue reasonably well.
This is the remaining problem. If there are to be these plus, minus functors where are they to reside or will they be the old favourites? regards Andy Little