I am trying to use alignas
for pointers that are class members, and frankly I am not sure where I supposed to put it.
For instance:
class A
{
private:
int n;
alignas(64) double* ptr;
public:
A(const int num) : n(num), ptr(new double[num])
{}
};
which I hoped would ensure the data for ptr was aligned on a 64-byte block. Using the Intel compiler, it doesn't.
Can anyone point me in the right direction please?