Delphi return value by reference

Viewed 1822

In C++ I can write a function like this:

int test(params) { }

And the value returned is only a number (r-value). But it is also possibile to do this:

int& test(params) { }

In this case the function returns a "complete variable". This means that the returned value is not just a value like before but it is a complete variabile having both r-value and l-value.

Is this possibile in Delphi? The first function would be function test(params):integer; but what about the second?

I have seen something similar when I try to implement a parallel for loop. Look at here there is an &. Does it have the reference meaning? I wasnt able to find a good answer by myself.

1 Answers
Related