insteadof operator
Nick Krempel
ndkrempel at google.com
Mon Jul 13 14:39:12 UTC 2015
On 11 July 2015 at 14:40, monolithed <monolithed at gmail.com> wrote:
> ```c++
> #include <iostream>
>
> static int foo = 1;
>
> int bar (const int &foo) {
> ::foo = 2;
>
> return foo;
> }
>
> int main () {
> std::cout << foo << ',' << bar(1) << std::endl; // 2,1
>
(This looks like undefined behavior as the evaluation of "foo" and the
function call "bar(1)" are indeterminately sequenced.)
return 0;
> }
> ```
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150713/f5fc5224/attachment-0001.html>
More information about the es-discuss
mailing list