Get difficulties with variadics

evilrat evilrat666 at gmail.com
Sat May 11 18:22:06 PDT 2013


On Saturday, 11 May 2013 at 22:01:33 UTC, Flamaros wrote:
> Thanks a lot, I think using Variant[] is a better way. For the 
> moment (maybe for few minutes) it's necessary to always give 
> the Variant array to the getResource method, but it can be null.
>
> I actually use derelict3, but for this VBO isn't not necessary 
> to have something much more advanced as it's only for a Quad 
> generated by hand. I am sharing the indexes VBO of Quads.
>
> The operational parameters can be useful to load a Texture from 
> an Image instance instead of only the filePath for exemple. 
> filePath also act as key to be able to get resources.

you don't even need to always pass null when you don't need 
anything, use default parameters.

void someFunc(Variant[] array = null) {...}
or
void anotherFunc(Variant[] array = Variant[].init) {...}

ok, if this is just a part of tutorial or demo i don't bother 
with my "tips" about api design anymore.


More information about the Digitalmars-d-learn mailing list