On Saturday, 20 May 2017 at 03:53:42 UTC, Vladimir Panteleev wrote:
On Saturday, 20 May 2017 at 03:24:41 UTC, 9il wrote:
What can I do to make it happen?

Sounds like you're asking for opIndex currying?

https://en.wikipedia.org/wiki/Currying

Have you tried implementing opIndex as a function which takes a single argument, and returns an object which then also implements opIndex with a single argument? You would probably need to write matrix[2][4] instead of matrix[2, 4], but that doesn't look hard to fix as well.

Yes, matrix[i][j] allows vectorization. This is already implemented. In the same time users prefer [i, j] syntax. So it should be deprecated :-/

As was said optimizsers can not split opIndex body because it is function (inlined or not inlined does not matter).

Have you tried splitting the opIndex implementation into two functions, one with just the code that should always be inlined, and one with the rest of the code that doesn't necessarily have to be inlined?

ditto

How about pragma(inline), does that help?

No

Reply via email to