<p><br>
Justin:<br>
> alias MyFoo = Foo!(opt1(23), opt2("foo"));</p>
<p>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).</p>
<p>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):</p>
<p>alias MyFoo = Foo!([Option1 : 123], [Option2 : "foo"]);</p>
<p>Where each AA literal is passed as a template alias parameter (or an element in a template tuple parameter):</p>
<p>... Foo(Options...)</p>
<p>I'm typing this on a pad, I cannot show some working code, but they idea is to check Options elements with </p>
<p>// Option[i] is an AA, for some Key and some Value<br>
is(typeof(Options[i]) == Value[Key], Value, Key)</p>
<p>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]]</p>