On 2016-01-24 14:24, Michel Fortin wrote:
On further thought, how do you make templates with specialization take
named arguments?
template TFoo(T) { ... } // #1
template TFoo(T : T[]) { ... } // #2
template TFoo(T : char) { ... } // #3
My guess would be this:
template TFoo(T:) { ... } // #1
template TFoo(T: : T[]) { ... } // #2
template TFoo(T: : char) { ... } // #3
... but it makes the declaration a bit strange.
Yes. Rule 7 covers that. There's also an example showing the syntax,
search for "Template specialization with named parameter". Yes, it does
look a bit strange.
--
/Jacob Carlborg