ultimately what I want to do is to use my 'Vec' class in conjunction with a matrix class 'Mat', where the objects are accessed as m(i,j), so I want to be consistent if i do this:


so, this way i can use in both cases () and not:



My problem is I must have the address of the first member of the 'Vec a' to do the following in order to pass the address to a external library which is written in C:

double *p;

p = &a(0);

Now, since my 'vector a' is not directly an object of the vector class, i think with the above i will not obtain the address unless I overload the '&' operator. If so, how can i do that? or how can i do something similar without overloading the '&' operator?