Split a C++ class declaration

后端 未结 5 800
野的像风
野的像风 2021-01-06 01:46

I want to know if I can split a C++ class declaration

Original class

    class P
    {
        private: 
           int id;
           //some really          


        
5条回答
  •  抹茶落季
    2021-01-06 02:08

    If your purpose is to simply reduce clutter in your header, you can include a file in the middle of your class:

    class P
    {
    #include "P.private_parts"
    
       protected:
           int x;
       public:
           P();
           int getX();
    };
    

提交回复
热议问题