www.digitalmars.com         C & C++   DMDScript  

D - implicit array declaration

reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
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?
Jan 23 2004
next sibling parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
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/
Jan 24 2004
parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
"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


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! :)
Jan 24 2004
prev sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
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
Jan 24 2004