C++ Multiple classes with same name

后端 未结 5 1969
春和景丽
春和景丽 2020-12-16 12:56

Say I have two different cpp files. Both declare classes with the same name, but perhaps a totally different structure (or perhaps the same structure, different implementati

5条回答
  •  无人及你
    2020-12-16 13:37

    I've seen these classes conflict. Is this expected by the standard?

    The standard says you can't do that. It would violate the one definition rule. (How to fix this has already been covered in other answers)

提交回复
热议问题