[Issue 5212] Safer typesafe variadics

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 13 13:48:23 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5212



--- Comment #3 from Sobirari Muhomori <dfj1esp02 at sneakemail.com> 2010-11-13 13:47:14 PST ---
(In reply to comment #1)
> > Just adding a dup inside the this() avoids the bug. Also, the bug is avoided if
> > Foo receives arguments like this:
> > 
> > Foo foo() {
> >     return new Foo([1, 2, 3]);
> > }
> 
> Is it valid to pass them byref here?
> It's a nice performance trick, but... shouldn't arguments be on the stack?

Steven has pointed out that one can discern between variadic arguments and an
array by creating an overload for array.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list