C++ Namespaces, comparison to Java packages

后端 未结 7 877
悲&欢浪女
悲&欢浪女 2021-01-31 08:07

I\'ve done a bunch of Java coding recently and have got used to very specific package naming systems, with deep nesting e.g. com.company.project.db. This works fine

7条回答
  •  情歌与酒
    2021-01-31 08:15

    You can have nested namespaces in C++.

    They don't work the same as in java, though, obviously. Java packages are really much better defined and there is no real static init weirdness. With C++ namespaces are helpful but still have a fair bit of danger involved.

提交回复
热议问题