Function pointers/delegates default args were stealth removed?

Walter Bright newshound2 at digitalmars.com
Mon Aug 27 14:11:49 PDT 2012


On 8/27/2012 3:32 AM, Manu wrote:
> Almost all my API's are dynamically bound to foreign code, eg:
>
> extern(C) void function( ref const(Vector2) v0, ref const(Vector2) v1, ref
> const(Vector2) v2, ref const(Color) color = Color.white, BlendMode blendMode =
> BlendMode.Disabled ) fillTriangle2D;

These can all be handled in a straightforward (but admittedly wordy) method of 
wrapping the call to the function pointer in an overloaded function.

I understand that you've probably got so many of these, it's drudgery to make 
the edits.

Question: are the default values all of the form T.init? I.e. is Color.white == 
Color.init?


More information about the Digitalmars-d mailing list