C++ class header files organization

前端 未结 6 1934
孤街浪徒
孤街浪徒 2020-11-29 18:03

What are the C++ coding and file organization guidelines you suggest for people who have to deal with lots of interdependent classes spread over several source and header fi

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 18:13

    One more point in addition to the others here:

    Don't include any private definitions in an include file. E.g. any definition that is only used in xxx.cpp should be in xxx.cpp, not xxx.h.

    Seems obvious, but I see it frequently.

提交回复
热议问题