3 ms·
To allow for chaining. Consider a statement like: a.f(foo(1)).g(foo(2)).arr[foo(3)].h(foo(4)); In C++14, the foo() calls happened in unspecified order. C+
by ynik 4y ago
To allow for chaining. Consider a statement like:
a.f(foo(1)).g(foo(2)).arr[foo(3)].h(foo(4));
In C++14, the foo() calls happened in unspecified order.
C++17 guarantees that "a(b)" and "a[b]" evaluate "a" first, which effectively means the foo() calls will now happen in order (1 to 4).