On 23/04/2011 15:45, Andrei Alexandrescu wrote:
On 4/23/11 8:57 AM, dsimcha wrote:
BTW, since when does the ternary operator work with functions, as
opposed to variables?


And that's since the C days btw. The function call is just an operation, the callee an operand, so any expression can be there.

They are converted to pointers to functions. Not something I'd recommend
because it makes the call slower.

Andrei

Hum, I didn't know that. Why does it make the call slower (other than the actual ternary operation), is it because it has to load the function address from a register/variable, instead of being a constant value? And/or not being able to inline the call? I mean, the first aspect seems like a very minor impact in performance, almost negligible.


--
Bruno Medeiros - Software Engineer

Reply via email to