Reputation: 310960
As it is known the order of evaluation of function arguments is undefined in C++. However in C# function arguments are evaluated from left to right. So the question arises: what is the order of evaluation of function arguments in C++/CLI? Does C++/CLI behave the same way as C++ relative to function arguments or as C#? I saw the ECMA #372 but I did not find any words on this question. Could someone give me a reference to a normative document where there is written what is the order of evaluation of function arguments in C++/CLI?
Upvotes: 2
Views: 348
Reputation: 38775
The C++/CLI spec does not mention it (as you say), and, as far as I can tell, the guaranteed order of evaluation is specified in the C# language spec, as opposed to being something specific to .NET
.
Since C++/CLI compiles to IL (just like e.g. VB.NET) I would say that nothing can be inferred for C++/CLI from the fact that C#, the language, guarantees anything.
Therefore it appears to be just as unspecified as for normal C++. Whether any rules of the .NET IL
cause certain evaluation order, I cannot say.
Upvotes: 1