Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 24, 2004 implicit array declaration | ||||
---|---|---|---|---|
| ||||
I'm trying to do the following: int_vector_t vi3 = new int_vector_t(int[] { 10, 11. 12 }); Is there any kind of support for this in the language? If not, can we have it? |
January 24, 2004 Re: implicit array declaration | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | Matthew wrote: >I'm trying to do the following: > > int_vector_t vi3 = new int_vector_t(int[] { 10, 11. 12 }); > >Is there any kind of support for this in the language? If not, can we have >it? > > > > > I asked for this also. You meant: int_vector_t vi3 = new int_vector_t(int[] { 10, 11, 12 }); right? -- -Anderson: http://badmama.com.au/~anderson/ |
January 24, 2004 Re: implicit array declaration | ||||
---|---|---|---|---|
| ||||
Posted in reply to J Anderson | "J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:butenu$qqj$1@digitaldaemon.com... > Matthew wrote: > > >I'm trying to do the following: > > > > int_vector_t vi3 = new int_vector_t(int[] { 10, 11. 12 }); > > > >Is there any kind of support for this in the language? If not, can we have > >it? > > > > > > > > > > > > I asked for this also. > > You meant: > > int_vector_t vi3 = new int_vector_t(int[] { 10, 11, 12 }); What's the difference? Ah, the comma - doh! :) |
January 24, 2004 Re: implicit array declaration | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | Matthew wrote:
> I'm trying to do the following:
>
> int_vector_t vi3 = new int_vector_t(int[] { 10, 11. 12 });
>
> Is there any kind of support for this in the language? If not, can we have
> it?
This works:
const int [] vecdata = [1,2,3];
int [] vec = vecdata.dup;
However, i would expect to be able to declare arrays inline... which is not possible yet. Are there any syntactic issues or is it just not implemented? Besides, run-time construction when necessry would be so cool! ;)
-eye
|
Copyright © 1999-2021 by the D Language Foundation