[Vala] probably silly question about vala objects



How can I store in an ArrayList objects of any type, including simple types?

Suppose that at run-time I always know which type the next element really is.

Is that possible?

I am not an expert of C, but I think in C that would be something like:
  void *c = malloc(sizeof <<name_your_type>>);
  //
  // push c in a queue
  //...
  // pop c from the queue
  <<name_your_type>> *x = ( <<name_your_type>> *)c;
  // do something with x
  free(x);

But how could such a thing be written in Vala and use automatic memory
management?

TIA
--Luca



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]