I don't get it. version(unittest) can't seem to use local variable

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 11 22:23:28 PDT 2014


On 07/11/2014 10:08 PM, dysmondad wrote:

 > class Velocity
 > {

[...]

 >      ref Velocity opOpAssign(string op) ( in float multiplier )

Unrelated to your question, you want to return just Velocity there. 
Unlike C++, classes are reference types in D. So, Velocity itself is 
essentially a Velocity* in C++.

Ali



More information about the Digitalmars-d-learn mailing list