[cpp-threads] Static member functions, member access syntax and sequenced-before

N.M. Maclaren nmm1 at cam.ac.uk
Wed Nov 23 19:23:05 GMT 2011


On Nov 23 2011, Peter Dimov wrote:
>>
>> If it is so specified, I can't find it, because 1.7 paragraph 15 and
>> 1.10 paragraph 9 are in terms of value computation, and there IS no
>> value computation involved in the call to Waitall!
>
> 1.9 [intro.execution] p15 in my N3290 says that "When calling a function 
> (whether or not the function is inline), every value computation and side 
> effect associated with any argument expression, or with the postfix 
> expression designating the called function, is sequenced before execution 
> of every expression or statement in the body of the called function."

That is what was referring to, of course.

>The postfix expression designating the called function is 
>requests[0].Waitall. The value computation of requests[0] is sequenced 
>before the function call. requests[0] is evaluated even when Waitall is 
>static. (5.2.5 [expr.ref] p1 and footnote 64).

You have missed out one essential step, which is the point I am raising.

requests[0] is evaluated, and let's assume that it is a value computation.
However, the actual value is NOT used in the 'evaluation' of
requests[0].Waitall, because that is done by member name lookup on the
class (i.e. the type of the value, and not the actual value).  There is
therefore an alternative, perfectly reasonable, interpretation.

That interpretation is that, logically, we have a we have a semantic
dependency like the following:

           Class Request
           |            \
           V             \
       requests[0]  .  Waitall

My point isn't that I can't deduce the intent, but that I can't find
wording that isn't also compatible with that one.

Regards,
Nick Maclaren.






More information about the cpp-threads mailing list