* 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
This commit is contained in:
Benoit Jacob
2009-01-06 03:16:50 +00:00
parent e71de20f16
commit 1c29d70312
12 changed files with 150 additions and 67 deletions

View File

@@ -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<bool Align> struct Depends
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(Align)
Vector2d m;
float f;
};
template<typename T>
void check_unalignedassert_good()
{
@@ -104,6 +112,8 @@ void unalignedassert()
check_unalignedassert_good<Good7>();
check_unalignedassert_good<Good8>();
check_unalignedassert_good<Good9>();
check_unalignedassert_good<Depends<true> >();
VERIFY_RAISES_ASSERT(check_unalignedassert_bad<Depends<false> >());
}
void test_unalignedassert()