Is there an equivalent to Delphi's absolute
in C++? I want to do the following:
// Structure A
struct A
{
double X;
double Y;
double Z;
}
// Structure B
struct B : A
{
double U absolute X;
double V absolute Y;
double W absolute Z;
}
I can use double & U = X
in structure B
but this will generate an additional pointer and change the size of the structure. Union is - I think - also not a solution, because structure B
inherits structure A
.
What I really want is to have access to the same memory by accessing for example X or U.