Justin:
> alias MyFoo = Foo!(opt1(23), opt2("foo"));

That's also my preferred solution. I find it easy to read and it's quite
typesafe (also, it allows for more complex possibilities like n-params
options).

Another solution could be to use an associative array literal for each
option (you have to use one AA for each option, because they can have
different types for keys and values):

alias MyFoo = Foo!([Option1 : 123], [Option2 : "foo"]);

Where each AA literal is passed as a template alias parameter (or an
element in a template tuple parameter):

... Foo(Options...)

I'm typing this on a pad, I cannot show some working code, but they idea is
to check Options elements with

// Option[i] is an AA, for some Key and some Value
is(typeof(Options[i]) == Value[Key], Value, Key)

and then act on the only key/value pair stored in Options. You can get the
only key with Options[i].keys[0] and the associated value with
Options[i][Options[i].keys[0]]

Reply via email to