Pointers to members in C++
A few days ago I was looking at some code and I found something I didn’t understand. It looked something like this:
1
2
void someFunction(int SomeClass::*value) {
...
I had never seen and * used after ::, so I had to do some research to find what that means. It turns out that is a pointer to a class member. In this post I’m going to explain how these work and when they might be useful.
Pointers to members
Pointers to members are pretty uncommon, so it will be very rarely that you will need to use them.
ncona.com