Translate C/C++ patern: return a pointer

biocyberman biocyberman at gmail.com
Sat May 26 09:19:01 UTC 2018


On Thursday, 24 May 2018 at 17:44:19 UTC, Jacob Carlborg wrote:
> 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.

Thanks. I did that and it worked correctly.


More information about the Digitalmars-d-learn mailing list