Accessing base member data error when derived class is templated

后端 未结 1 1925
无人共我
无人共我 2021-01-24 09:41

I have the following problem with the curiously recurring template, with a problem when I try to access the data member of CRTP base class.

template

        
1条回答
  •  清歌不尽
    2021-01-24 09:58

    It doesn't really have to do with CRTP, but rather with the fact that for dependent-base-accessing derived code, you need to qualify things.

    Changing the line to

    std::cout<protectedData<

    solved it.

    See accessing a base class member in derived class.

    0 讨论(0)
提交回复
热议问题