Reputation: 19033
class A
{
float m_Period; // a1
float m_Scale; // a2
};
I can have pointer to a data member like this:
float A::*pFloat;
For reason of handle members in cycle i need an array of such pointers. How to do this.
Upvotes: 2
Views: 115
Reputation: 153909
Either std::vector<float A::*> pFloats;
or, if you need static initialization with the compiler counting the number of initializers, float A::*pFloat[] = {...};
.
Upvotes: 3
Reputation: 279255
typedef float A::*member_t;
Now you can declare an array or vector
of member_t
.
Upvotes: 5