On Thu, 05 Jun 2014 18:42:29 -0400, Brad Anderson <e...@gnuk.net> wrote:
On Thursday, 5 June 2014 at 22:06:02 UTC, monarch_dodra wrote:
On Thursday, 5 June 2014 at 08:49:18 UTC, Jonathan M Davis via
Digitalmars-d
long days;
int seconds;
short msecs;
d.split!("days", "seconds", "msecs")(&days, &seconds, &msecs);
Please don't use pass-by-pointer in D APIs. It makes it a real
*nightmare* to ever use the code in a safe context. Besides, we have
ref. The only arguments "for" pass by pointer afaik are:
- retain existing/C api (1)
- allow null pointers (2)
(1) is not applicable, I think.
(2) would only make sense if split did not have a template parameter,
and took "all" arguments, and only filled the non-null ones.
So, please make these pass by ref.
Even better than ref would be out which guarantees that the input
parameter values do not affect the function.
I think that would be 'out'
-Steve