Pointer to class member as a template parameter

后端 未结 4 703
小蘑菇
小蘑菇 2020-12-09 09:27

I want to use a pointer to a class member as a template parameter as in:

template 
struct MyStruct {
         


        
4条回答
  •  庸人自扰
    2020-12-09 09:42

    Make your result class a child of your template class. assuming the pointer member is an object of your result class in public or whatever, you can access any objects by doing something like this

    template  :: public result
    {
        blah
    }
    

提交回复
热议问题