Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2004-02-08 16:33:13


On Sunday 08 February 2004 03:27 pm, Brian McNamara wrote:
> Seriously, can you show a case how "educated guess" is better than
> nothing? My instincts tell me that it's better to fail to compile than
> to guess the wrong type and start having random implicit conversions
> start kicking in.

As with result_of, if you have to guess, guess void. When you're right, it
works; when you're wrong, it fails to compile.

> In the (rare?) case where the return type of F doesn't depend on its
> arguments, then it either (a) it should probably just declare an
> F::result_type (in which case I think result_of<F> may work),

If F::result_type exists, result_of will use it. For compilers that can't
handle SFINAE, I think we'll always have to go with F::result_type.

        Doug


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