This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Nested classes and alignment requirements?

Tags: None
(comma "," separated)
tgot
Registered Member
Posts
2
Karma
0
All,

I'm wondering about the alignment requirements for nesting classes that use fixed-size matrices. I read the excellent documentation describing the why of such classes, such as:
Code: Select all
class Foo
{
  double x;
  Eigen::Vector2d v;
public:
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};


The question I have is whether that alignment is now propagated, such that it is safe to have classes such as:
Code: Select all
class Bar
{
  char x;
  Foo foo;
public:
};
class Baz
{
  char x;
  Foo foo;
  short y;
  Bar bar;
public:
};


Or, would Bar and Baz be required to have the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro in the public: section?

Thank you.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell