4 ms·
(I am not a .net developer) But having read the msdn description of the ref keyword http://msdn.microsoft.com/en-gb/library/14akc2c7(v=vs.71).aspx http://msdn.
by fmstephe 14y ago
(I am not a .net developer) But having read the msdn description of the ref keyword
http://msdn.microsoft.com/en-gb/library/14akc2c7(v=vs.71).aspx http://msdn.microsoft.com/en-gb/library/14akc2c7(v=vs.71).as...
I would expect that refs are roughly equivalent to the following
http://play.golang.org/p/3cwx5Qofc8 http://play.golang.org/p/3cwx5Qofc8
Where the commented out code represents the .net equivalent. I would expect that the .net compiler simply rewrites your code for you to hide the slightly tricky messing about with pointers. So the .net ref looks like a bit of syntactic sugar over what you were trying to do in your post.