Translate C/C++ patern: return a pointer

biocyberman biocyberman at gmail.com
Thu May 24 09:10:36 UTC 2018


On Thursday, 24 May 2018 at 08:58:02 UTC, Nicholas Wilson wrote:
> On Thursday, 24 May 2018 at 08:16:30 UTC, biocyberman wrote:
>> [...]
>
> it looks like Read is a D class? in which case it already 
> returns by reference.
> If you make Read a struct then all you need do is change the 
> function signature from
> Read reverseComplement()
> to
> Read* reverseComplement()
>
> about the function body
> use mQuality.dup.representation.reverse;
>
>>     [...]
>
> does not do what you want it to do.

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


More information about the Digitalmars-d-learn mailing list