[eigen] Structures having Eigen members and make_shared |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Structures having Eigen members and make_shared
- From: Hervé Audren <h.audren@xxxxxxxxxx>
- Date: Thu, 23 Jun 2016 09:55:09 +0900
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=h.audren@xxxxxxxxxx;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aist.go.jp; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ginlycjIhmfpQ4C8BZpcIpHqcRXJcsRqx6FkG4+SmuM=; b=YpJFzejp1RiOwk0I188nFZAschBdEsiQD/+Qs4aBEOgJedD/DxUwTGok7UCs/HmSIRa7GTMQKrflQsGR9HQFudYCwvfCMEoPQTYQLe8bE7wYYiPr0+lrgTRIpKzX0kXUzqGwAjmPfhNn7Ma/qg+qW6sMKUB6pMAoovouEcBUTgQ=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hello,
We recently ran into a "bug" where we had a structure containing Eigen
members that triggered the infamous "unaligned array" assertion.
Unfortunately, the solution proposed by the Eigen documentation is to
add EIGEN_MAKE_ALIGNED_OPERATOR_NEW somewhere in the code, but it does
not have any effect on make_shared<MyStruct>(args).
As I understand it, Eigen will try to keep C++03 compatibility as much
as possible, and I am not sure it is possible to support this C++11
feature without breaking that. Maybe the documentation could be updated ?
Note: a simple fix is to use the slightly less efficient:
my_ptr = std::shared_ptr<MyStruct>(new MyStruct).
Cheers,
Hervé