Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-10-07 11:38:03

On Sunday 07 October 2001 10:42, you wrote:
> That said, this decision is not set in stone. Are void returns on MSVC 6 a
> killer feature? Keep in mind that MSVC 7 supports them.

I would suggest that the 'void returns' workaround always be present, even if
the compiler supports void returns. Then not only will this work:

struct f { void operator()(int) const; };
bind<void>(f(), _1);

But also one can have:

struct g { int operator()(int) const; };
bind<void>(g(), _1);

So effectively bind can be asked to ignore a return value. Function does
this, so "boost::function<void, int>(g()))" is valid and will swallow the
result of "g" when called. I believe Jesse Jones had a very good argument for
this behavior (it swayed me, at least), though I wasn't able to find it in
the archives.


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