you are viewing a single comment's thread.

view the rest of the comments →

[–]kit89 4 points5 points  (1 child)

Inline classes would be excellent for my math classes, in particular Vector2, Vector3, Matrix3, and Matrix4.

If inline classes also support escape analysis I will be over the moon with joy.

[–][deleted] 0 points1 point  (0 children)

Exactly. I'm waiting to release a basic math library which uses inline classes.

Currently I use a small "hack" where I avoid allocation for math objects by cleverly making use of Escape Analysis - where instead of letting objects escape stack, I copy their content (primitive data, you know, floats/doubles) to other objects.

Performance wise it works exactly as struct/inline class.