ref type versus ptr type on input

Namespace rswhite4 at googlemail.com
Sun Dec 29 13:47:51 PST 2013


On Sunday, 29 December 2013 at 19:42:39 UTC, Jonathan wrote:
> If I want to write a function that operates on a struct
>
> struct S { }
>
> What are the differences between:
>
> void(S* s)
>
> void(ref S s)

You cannot set a default value (like null) for ref parameters, 
but you can for pointer.



More information about the Digitalmars-d-learn mailing list