Is it possible to create a mixed array in vala? -


in vala see when declare array have specify type, like

int[] myarray = { 1, 2, 3 }; 

i wonder if there way have mixed array like

smtg[] myarray = { 1, 'two', 3 }; 

i see in this question in c++ , c# it's not possible started learning vala , have no background c-like language want sure.

no.

that said, can create array of can hold other types, glib.value or glib.variant, , vala can automatically convert to/from two, like

glib.value[] values = {   1,   "two",   3.0 } 

it's terrible idea (you're throwing away compile time type safety), can it.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -