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

N.M. Maclaren nmm1 at cam.ac.uk
Wed Nov 23 23:08:58 GMT 2011


On Nov 23 2011, Peter Dimov wrote:
>
>> 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).
>
>Nevertheless, the function call is sequenced after this value computation. 
>There is no text that allows it not to be, if its value is not used.
>
>To give you a crude analogy, in
>
>    f( 0 * g() );
>
>the value of g() is not used in the call to f(), but it's still sequenced 
>before it. There is no special case in the wording that allows 
>sequenced-before to not apply if a value is not used. 

I posted too much in haste, I am afraid.  What I should have said is that
the value computation of requests[0] is not used in the value computation
of requests[0].Waitall.  I quite agree that the analogy would apply if it
were merely that the value itself were what is ignored.

The point is that, if you write down a syntactic dependency tree based on
the specification in the standard (i.e. excluding any details of what the
actual values are), you get to the situation that the evaluation of the
expression requests[0].Waitall is not dependent on the evaluation of the
expression requests[0].

Regards,
Nick Maclaren.






More information about the cpp-threads mailing list