The following should not work: void test(const Eigen::VectorXd& x) { Eigen::VectorXd a; // a.col(0).swap(x); // fails as intended a.col(0).swap(x, 0); // Manually set sanity check parameter // Ref<Eigen::VectorXd> rX(x); // fails as intended Ref<Eigen::VectorXd> rX(x, &a, 0); // Manually set sanity check parameters } Generally, I'd suggest to avoid adding sanity-check parameters to the public interface. If they are required, it is usually cleaner to hide them into a private function and have a "clean" wrapper function for the interface. This also avoids the problem of accidentally passing bogus parameters to functions which are not used.
https://bitbucket.org/eigen/eigen/commits/06d4fff20a93/ Changeset: 06d4fff20a93 User: ggael Date: 2014-11-05 15:15:17+00:00 Summary: Big 853: replace enable_if in Ref<> ctor by static assertions and add failtests for Ref<>
The .swap() case still compiles.
oops, I focused too much on Ref. https://bitbucket.org/eigen/eigen/commits/167ce78594dc/ Changeset: 167ce78594dc User: ggael Date: 2014-11-06 08:25:26+00:00 Summary: Bug 903: clean swap API regarding extra enable_if parameters, and add failtests for swap
-- 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/903.