What are the advantages and disadvantages of implementing classes in header files?

后端 未结 6 1226
北荒
北荒 2020-12-03 11:49

I love the concept of DRY (don\'t repeat yourself [oops]), yet C++\'s concept of header files goes against this rule of programming. Is there any drawback to defining a clas

6条回答
  •  时光取名叫无心
    2020-12-03 12:23

    The main disadvantage (apart from the lengthy builds) is there is no clear separation of the interface and implementation.

    Ideally, you should not need to see the implementation of an intuitive, and well documented interface.

提交回复
热议问题