hi - Some of the Eigen objects define their own new/delete operators. However, these definitions omit placement array new (but both array new and placement new are there). As an example, this doesn't compile (tested against eigen-5097c01bcdc4, but from inspection of the source in the repository, this should still be there in the latest version): ------------- #include <Eigen/Core> void* test(size_t sz, void* p) { return new (p) Eigen::Matrix<double, 3, 1>[sz]; } ------------- This gives a compilation error starting with ------------- etest.cc: In function ‘void* test(std::size_t, void*)’: etest.cc:5:48: error: no matching function for call to ‘Eigen::Matrix<double, 3, 1>::operator new [](sizetype, void*&)’ return new (p) Eigen::Matrix<double, 3, 1>[sz]; ^ ------------- This came about trying to generate wrappers for calling Eigen objects from python / interpreted C++ using root (http://root.cern.ch); the automatically-generated wrapper code calls placement array new. If i add a definition for placement array new along the lines of the existing non-array placement new (see attached patch), then the error goes away. thanks, sss
Created attachment 401 [details] patch
thank you for the report. I made it static and also added the respective placement array delete: https://bitbucket.org/eigen/eigen/commits/a44c47417c23/ Changeset: a44c47417c23 User: ggael Date: 2013-11-27 09:46:59 Summary: Fix bug 708: add placement new/delete for array https://bitbucket.org/eigen/eigen/commits/39f422316ae8/ Changeset: 39f422316ae8 Branch: 3.2 User: ggael Date: 2013-11-27 09:46:59 Summary: Fix bug 708: add placement new/delete for array (transplanted from a44c47417c2319d737b8b99bb22dfae276a9757f)
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/708.