Re: Does remove immutability using cast to pass in a function make sense?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 02:07:09 UTC, AsmMan wrote: I have this array: static immutable string[] months = [jan, fev, ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a

Re: Does remove immutability using cast to pass in a function make sense?

2014-09-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/22/14 10:07 PM, AsmMan wrote: I have this array: static immutable string[] months = [jan, fev, ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a reason related to design why it

Re: Does remove immutability using cast to pass in a function make sense?

2014-09-23 Thread AsmMan via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 03:34:22 UTC, Ali Çehreli wrote: If it still doesn't work for you please show us a minimal program that demonstrates the problem. Ali Ok, the case is the follow, I updated my dmd compiler some days ago (after my mono crashed and I lost some of D files, I

Does remove immutability using cast to pass in a function make sense?

2014-09-22 Thread AsmMan via Digitalmars-d-learn
I have this array: static immutable string[] months = [jan, fev, ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a reason related to design why it doesn't work with immutables or

Re: Does remove immutability using cast to pass in a function make sense?

2014-09-22 Thread Ali Çehreli via Digitalmars-d-learn
On 09/22/2014 07:07 PM, AsmMan wrote: I have this array: static immutable string[] months = [jan, fev, ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a reason related to design why