Hiding private data members? (C++)

后端 未结 5 2046
北海茫月
北海茫月 2020-12-13 00:21

Is there a way to hide private data members of a C++ class away from its users, in the cpp file? I think of the private members as part of the implementation and it seems a

5条回答
  •  死守一世寂寞
    2020-12-13 00:53

    The classic way to do this is with a proxy pointer to an internal class which implements the functionality. There's no way to do partial class definitions in C++ that I know of.

提交回复
热议问题