C++ Access private member of nested class

前端 未结 3 1622
再見小時候
再見小時候 2021-01-19 10:21

The title might be a bit misleading. I have the following problem: I have a tree consisting of leaves and internal nodes. The user should be able to store any information in

3条回答
  •  囚心锁ツ
    2021-01-19 11:05

    You can declare class Tree a friend to UserElement<>, which would allow Tree to access all members of UserElement<>.

提交回复
热议问题