On 1/30/2014 9:30 AM, 嘱 Tiib wrote:
>[..]
> Why ability to return is more essential for template programming than
> ability to "pass" it to other callable? Other problem is that passing void
> arguments does not seem to be even forbidden ... it seems to be
> undefined.
A function wrapper needs the return value type defined (or deduced) and
if/when the call is forwarded to the wrapped object, the return value
needs to be retained and returned to the caller [of the wrapper]. I am
guessing (since I've not followed that particular development in the
language) it to be the reason for introducing the ability to have a void
expression in a return statement. If I were to invent a situation in
which "passing" would be generically necessary, I can only think (right
now) of a "broker" emulator, some mechanism that calls one side and then
the other, while passing the return value of one to the other as its
argument, without necessarily knowing (or caring) what that value is or
where it exists (in the case of 'void'). Apparently the library
designers didn't think it common enough a problem to introduce such a
mechanism into the library. IOW, if you need one, you'd roll your own
instead of instantiating some standard template...