While the second part of the ternary operator is self contained, the third part is not. The grammar is as follows:
conditional-expression:
logical-or-expression
logical-or-expression ? expression : assignment-expression
So your function call is effectively this:
SetSize((true ? (12.f, 50.f): 50.f), 12.f)
So the ternary expression true ? (12.f, 50.f): 50.f gets evaluated as the first parameter to the function. Then 12.f is passed as the second value. The comma in this case is not the comma operator but the function parameter separator.
From section 5.18 of the C++ standard:
2 In contexts where comma is given a special meaning, [
Example: in lists of arguments to functions (5.2.2) and lists of initializers (8.5) — end example ] the comma operator as described
in Clause 5 can appear only in parentheses. [
Example:f(a, (t=3, t+2), c);has three arguments, the second of which has the value 5 . — end
example ]
If you want the last two subexpressions to be grouped together, you need to add parenthesis:
SetSize(true ? 12.f, 50.f : (50.f, 12.f));
SetSize(false ? 12.f, 50.f : (50.f, 12.f));
Now you have a comma operator and the single argument version of SetSize gets called.