Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualJason Goepel

Posted 11 October 2013 - 11:16 AM

I see the format of the list pattern contains a "repeat" identifier.   It looks like my Matrix class (which contains doubles) would register its list factory like so:

engine->RegisterObjectBehaviour("Matrix", asBEHAVE_LIST_FACTORY, "Matrix@ f(int&in list) {repeat {repeat double}}", ...);

Is there any way to register the list pattern such that the inner lists all must have the same dimension?

Matrix A = { {1.0, 2.0}, {3.0, 4.0} };  // Successful
Matrix B = { {1.0},      {3.0, 4.0} };  // Compile Error

I realize I can inspect the pattern at runtime to determine whether it meets any special criteria.


#1Jason Goepel

Posted 11 October 2013 - 11:12 AM

I see the format of the list pattern contains a "repeat" identifier.   It looks like my Matrix class (which contains doubles) would register its list factory like so:

engine->RegisterObjectBehaviour("Matrix", asBEHAVE_LIST_FACTORY, "Matrix@ f(int&in list) {repeat {repeat double}}", ...);

Is there any way to register the list pattern such that the inner lists all must have the same dimension?

Matrix A = { {1.0, 2.0}, {3.0, 4.0} };  // Successful
Matrix B = { {1.0},      {3.0, 4.0} };  // Compile Error

PARTNERS