function ref param vs pointer param

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 24 07:15:25 PDT 2015


On 04/24/2015 06:23 AM, ref2401 wrote:

 > What advantages do ref params give over pointer params?

Another difference is that a ref parameter is not null and what is 
referred to is not an rvalue.

However, it is possible to break that expectation if a pointer is 
dereferenced and passed to a ref-taking function but then the actual 
object is gone before the reference is used.

Ali



More information about the Digitalmars-d-learn mailing list