struct MyStruct {
typedef int MyStruct::*Ptr; // my pointer-to-member type
int foo, bar;
};
This code works, but I'd like to bring it up-to-date with modern style and replace the typedef with a using. What's the right syntax to use? I've tried a bunch of options and I'm stuck; the only examples I can find are for pointer-to-member-function which is different.
The using syntax just moves the identifier placement, the general case is that
typedef ............. foo ..............;
can be changed to
using foo = ............. .............;
Your case is no exception; the code could be using Ptr = int MyStruct::*;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With