On 02/21/14 18:57, Uranuz wrote:
> In my template functions, classes it's necessary to write variadic template
> parameter list, where elements are options to this class/function changing
> it's behaviour. But they are optional and may be not set at all. These
> options may be folowed by variad
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
On Fri, 21 Feb 2014 19:09:56 +, Uranuz wrote:
>> You could do something like this:
>>
>> alias Foo!(
>> OptionType.optType1, 100, OptionType.optType2, "example,
>> ...etc...
>> ) MyFoo;
>
> Yes. I already use this. But it makes it not semanticaly obvious that
> OptionType.optType1 is
You could do something like this:
alias Foo!(
OptionType.optType1, 100,
OptionType.optType2, "example,
...etc...
) MyFoo;
Yes. I already use this. But it makes it not semanticaly obvious
that OptionType.optType1 is a kind of `key` and 100 is `value`.
Also it needs to parse it and
On Fri, 21 Feb 2014 17:57:57 +, Uranuz wrote:
> My idea is that pass these options using syntax like this:
>
> alias Foo!( [
>OptionType.optType1 : 100, OptionType.optType2 : "example",
>"someOtherOpt1": "someOtherOptValue", "someOtherOpt2": true
> ] ) MyFoo;
>
> Using [] brackets
In my template functions, classes it's necessary to write
variadic template parameter list, where elements are options to
this class/function changing it's behaviour. But they are
optional and may be not set at all. These options may be folowed
by variadic template parameter list that will be