Reading the Eigen library documentation, I noticed that some objects cannot be passed by value. Are there any developments in C++11 or planned developments that will make it safe to pass such objects by value?
Also, why is there no problem with returning such objects by value?
They could do this in C++11:
Now the class will always be aligned on a 16-byte boundary.
Also, maybe I’m being silly but this shouldn’t be an issue anyway. Given a class like this:
Compilers are now obligated to allocate a
Matrix4fon a 16-byte boundary anyway, because that would break it; the class-levelalignasshould be redundant. But I’ve been known to be wrong in the past, somehow.