Pros and cons of using nested C++ classes and enumerations?

前端 未结 13 2202
悲&欢浪女
悲&欢浪女 2020-11-29 23:43

What are the pros and cons of using nested public C++ classes and enumerations? For example, suppose you have a class called printer, and this class also store

13条回答
  •  没有蜡笔的小新
    2020-11-30 00:10

    It seems like you should be using namespaces instead of classes to group like things that are related to each other in this way. One con that I could see in doing nested classes is you end up with a really large source file that could be hard to grok when you are searching for a section.

提交回复
热议问题