Hi Blazej, My best guess is that when Eigen was initially developed targeting c++03, there wasn't a standard way of ensuring that parameters passed by value retain their alignment. With modern C++, in theory you can do that using alignas.
On Mon, Nov 16, 2020 at 4:48 AM Blazej Slusarek <[email protected]> wrote: > Bumping the thread. Does anyone know anything about this? > > BR, > Blazej > > On Fri, Nov 6, 2020 at 11:10 AM Blazej Slusarek <[email protected]> > wrote: > >> Hello! >> >> I recently stumbled upon this link: >> https://eigen.tuxfamily.org/dox/group__TopicPassingByValue.html >> which (in short) says that passing Eigen objects by value is wrong. I'd >> like to get more info on that: >> * When is this wrong? Is the object aligned when I create it but not when >> I make a copy of it on stack to pass it to a function? Could someone >> provide an example explaining what goes wrong? >> * How is this avoided in case of returning by value? >> * Does this affect custom-defined types of like Eigen::Matrix<2, -1, 0, >> 2, 3> (or Eigen::Matrix<2, 3, 0, 2, 3>) ? >> >> Best regards, >> Blazej >> >
