Vararg-templated class with matching member func

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sat Apr 6 16:43:34 PDT 2013


I have a feeling I'm missing something obvious, but how do I create
something like this?:

class Foo(TArgs...)
{
    void func(/+ args must exactly match TArgs +/)
    {
    }
}

new Foo(int).func(5); // Ok
new Foo(int, string).func(5, "hello"); // Ok

// Error! Overload not found!
new Foo(int).func(5, 8);
new Foo(int).func("hellO");

// Error! Overload not found!
new Foo(int, string).func(5);
new Foo(int, string).func("hello");

Maybe it's just a slow-brain day, but I'm having trouble working out
the right syntax for that.



More information about the Digitalmars-d-learn mailing list