Re: const types can't be specialized non-const, if arrays?

2016-06-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/16/16 3:43 PM, cy wrote: I don't get it. Do I have to write a separate template for arrays specifically or something? NonConst foo(Constant: const NonConst, NonConst)(Constant bar) { pragma(msg,"NonConst is ",NonConst); pragma(msg,"Constant is ",Constant); NonConst foo = bar;

const types can't be specialized non-const, if arrays?

2016-06-16 Thread cy via Digitalmars-d-learn
I don't get it. Do I have to write a separate template for arrays specifically or something? NonConst foo(Constant: const NonConst, NonConst)(Constant bar) { pragma(msg,"NonConst is ",NonConst); pragma(msg,"Constant is ",Constant); NonConst foo = bar; return foo;