Could we create a structure that contains some values and the reference that is pointing to the values in the same structure? My idea is to make the alias. So I can call struct members in different way !
struct Size4
{
float x, y;
float z, w;
float &minX, &maxX, &minY, &maxY;
Size4(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w),
minX(x), maxY(y), minY(z), maxY(w)
{
}
};
Thank you all.
NB: I did it with the pointer, but now when I'm trying to call Size4.minX()
I'm getting the address, but not the value.
struct Size4
{
float x, y;
float z, w;
float *minX, *maxX, *minY, *maxY;
Size4(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w),
minX(&x), maxX(&y), minY(&y), maxY(&w)
{
}
};