• Advertisement
Sign in to follow this  

List Pattern

This topic is 1561 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Edited by Jason Goepel

Share this post


Link to post
Share on other sites
Advertisement

It's not yet possible to declare the pattern to guarantee that all sublists are of the same size, but it is planned. It will look something like this:

 

"Matrix@ f(int&in list) {repeat {repeat(x) double}}"

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement