in reply to Evaluation Order again.

Even if you would like to blame the “exce ssive” chaining, remember that expressions of the form std::cout << f() << g() << h() usually result in chaining, after the overloaded operators have been resolved into function calls. It is the source of endless headaches. Newer library facilities such as std::future<T> are also vulnerable to this problem. when considering chaining of the then() member function to specify a sequence of computation.
As usual, C++ keeps introducing features that are supposed to fix previous C++ features.

Replies are listed 'Best First'.
Re^2: Evaluation Order again.
by BrowserUk (Patriarch) on May 28, 2016 at 01:04 UTC
    As usual, C++ keeps introducing features that are supposed to fix previous C++ features.

    To be fair, C++ inherited the undefined execution order from C (from bcpl from B from ... ). It was the done thing to leave such implementation details "to the implementation"; and expect programmers to perceive all the situations where they might be bitten by that seemingly innocuous statement.

    One of the driving forces behind this is one of the other goals of C++17; that of introducing implicit parallelisations. Another suggested benefit roundly poo hoo'd in that old thread.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Don't take me wrong, I'm not saying that the order of evaluation of lists in Perl has a good reason to be undefined. I don't know if there such a reason; I suspect there isn't.
      To be fair, C++ inherited the undefined execution order from C (from bcpl from B from ... ).
      And inheriting various crap from C was also very much a feature (that needed - still needs - subsequent fixing)!