Translate C/C++ patern: return a pointer

Jacob Carlborg doob at me.com
Thu May 24 17:44:19 UTC 2018


On 2018-05-24 11:10, biocyberman wrote:

> Thanks for the hints. `Read` in C++ and D are both classes. And the 
> function is inside the class definition itself.

In that case specifying the type as `Read` is the correct thing to do. 
Note that `new` always allocates on the heap and returns a pointer or 
reference type.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list