Why using alignof on non-typed types is valid?

71 Views Asked by At

The data shows that alignof is used type-id, but why I can use Eigen::Matrix4f like below.

Eigen::Matrix4f t_localizer = ndt.getFinalTransformation();
std::cout << "t_localizer alignof: " << alignof(t_localizer);  // ??
std::cout << "t_localizer alignof: " << alignof(Eigen::Matrix4f); // valid

Both codes can compile and work!

0

There are 0 best solutions below