The size constraint for dynamic array of primitive data type works fine.
when changing from primitive to class object, it does not work, because this will incur null pointer error.
rand my_class my_q1; // my_class is a custom class with rand variables here
rand int my_size;
my_q1.size() == my_size; // doesn't work here because no object constructed.
//other constraint over my_q1 elements
my question is:
Q1:why doesn't constraint solver call class's default constructor when solving the constraint in this case?
Q2:are there any other ways to achieve this? I know I could randomize my_size outside first and passed in as an normal int, and construct my object array inside pre_randomize function, but I'd like to do the randomization all at once if possible.