This is my first post. I read the FAQ, but if I'm violating any etiquette, please let me know.
I am having trouble with Angelscript syntax. Is there any way to create a temporary array? I'd like to pass one to a class constructor without creating an array variable beforehand. That way the array only exists for the purpose of object construction.
I've posted my test class below, along with how I'm currently accomplishing this by declaring an array before the object creation, and also what I'm trying to do.
class MyObj
{
MyObj(const uint[]@ vals)
{
_values = vals;
}
const uint[]@ get_values() const
{
return _values;
}
void set_values(const uint[]@ vals)
{
_values = vals;
}
uint[] _values;
}
// How I'm doing this now
uint[] input = { 20, 40, 60, 80, 100 };
MyObj instance(input);
// How I would like to do it, if possible
MyObj instance( { 20, 40, 60, 80, 100 } );