From 1c29d703123f876d75885a03b10c5deb3d36813f Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 6 Jan 2009 03:16:50 +0000 Subject: * introduce macros to replace inheritance for operator new overloading (former solution still available and tested) This plays much better with classes that already have base classes -- don't force the user to mess with multiple inheritance, which gave much trouble with MSVC. * Expand the unaligned assert dox page * Minor fixes in the lazy evaluation dox page --- test/unalignedassert.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/unalignedassert.cpp') diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp index 0b5bf0c77..2d0b5a015 100644 --- a/test/unalignedassert.cpp +++ b/test/unalignedassert.cpp @@ -61,8 +61,9 @@ struct Good7 : Eigen::WithAlignedOperatorNew float f; // make the struct have sizeof%16!=0 to make it a little more tricky when we allow an array of 2 such objects }; -struct Good8 : Eigen::WithAlignedOperatorNew +struct Good8 { + EIGEN_MAKE_ALIGNED_OPERATOR_NEW float f; // try the f at first -- the EIGEN_ALIGN_128 attribute of m should make that still work Matrix4f m; }; @@ -73,6 +74,13 @@ struct Good9 float f; }; +template struct Depends +{ + EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(Align) + Vector2d m; + float f; +}; + template void check_unalignedassert_good() { @@ -104,6 +112,8 @@ void unalignedassert() check_unalignedassert_good(); check_unalignedassert_good(); check_unalignedassert_good(); + check_unalignedassert_good >(); + VERIFY_RAISES_ASSERT(check_unalignedassert_bad >()); } void test_unalignedassert() -- cgit v1.2.3