I’m trying to pass a member variable into a template. In example, if I have the following:
struct MyStruct
{
MyType MyMember;
}
How can I do something like:
MyType MyVar = MyTemplate<MyStruct, &MyStruct::MyMember, MyType>();
I tried to search around and didn’t find anything that explain exactly how to achieve that… Sorry if that is a stupid question, I’m pretty new to c++…
Any help is welcome!
Here goes something:
and you can use it like this: