Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-10-11 13:08:49


On Sat, Oct 11, 2003 at 08:37:24PM +0300, Peter Dimov wrote:
> Joel de Guzman wrote:
>
> > typedef result_of_plus<int, double>::type result;
>
> You should name that
>
> typedef result_of<plus(int, double)>::type result;
>
> instead. :-)

There is a smiley, but seriously, if you did

   struct op_plus {
      template <class R> struct result;
      template <class F, class A1, class A2> struct result<F(A1,A2)> {
         typedef typename result_of_plus<A1,A2>::type type;
      };
   };
   // etc.

then

   typedef result_of< op_plus(int, double) >::type result;

would truly work. (Names like op_plus are just used as tags which stand
for the corresponding C++ operators.)

-- 
-Brian McNamara (lorgon_at_[hidden])

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