www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - ref tidy way to defreference or is something else going on ?

reply Codifies <a b.com> writes:
I've a bunch of 4x4 matrix routines in C, in order to avoid 
copying around multiple 4x4 matrices I pass pointers...

I'm assuming that in D it would make sense to use ref ?

what's going on behind the scenes with ref is it just a nice way 
of passing pointers with automagical dereferencing or is 
something more going on?
Oct 16 2018
parent rikki cattermole <rikki cattermole.co.nz> writes:
On 16/10/2018 11:36 PM, Codifies wrote:
 I've a bunch of 4x4 matrix routines in C, in order to avoid copying 
 around multiple 4x4 matrices I pass pointers...
 
 I'm assuming that in D it would make sense to use ref ?
 
 what's going on behind the scenes with ref is it just a nice way of 
 passing pointers with automagical dereferencing or is something more 
 going on?
Yup, exactly!
Oct 16 2018