Quote Originally Posted by mickey View Post
Isn't ................._vec.at(0). an instance of a class? I don't understand.....
Yes, it it, but "objA._vec.at(0).fptr[0]" is an expression which returns a pointer to member. It doesn't mean "invoke the method that fptr[0] points to". As caduel wrote you have to use special syntax to invoke that method.

Quote Originally Posted by mickey View Post
Can you give me an example of what you mean with overload an operator for this case?
The user of your class wants to perform some action depending on integer value. If you make him use pointers to members everywhere the code will be error-prone and unreadable. It is better to hide this inside your class and give your user only a convenient method and an enum:
Qt Code:
  1. double db = obj.get( B::GeometricMean );
  2. // or using an operator:
  3. double db = obj[ B::GeometricMean ];
To copy to clipboard, switch view to plain text mode