Boost logo

Boost :

From: quality_object_software (rubin_at_[hidden])
Date: 2002-01-12 20:44:52


Currently, Loki's Functor is declared as:

     template<typename R, ...

That is, the return type R has no default value. It seems to me
that it should default to void.

Rationale:

1. In general, it makes sense to provide a default value if there's
a unique, useful value, especially one that's commonly used. I've
often used the Command design pattern(tm); most of the time I return
void.

2. "Don't return anything" is conceptually simpler than "Return an
object of type R".

3. Beginners are likely to start with the simplest thing. They
shouldn't have to think about the concept of returning a value when
they're not even using it. (One could argue that this holds true
for veterans, too.)

I see no down-side to this proposal. But perhaps I'm missing
something.

Bill Rubin


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