Why and how should I use namespaces in C++?

后端 未结 6 1683
甜味超标
甜味超标 2020-12-02 18:59

I have never used namespaces for my code before. (Other than for using STL functions)

  1. Other than for avoiding name conflicts, is there any other reason to use
6条回答
  •  时光说笑
    2020-12-02 19:30

    1. Answer: If you ever want to overload the new, placement new, or delete functions you're going to want to do them in a namespace. No one wants to be forced to use your version of new if they don't require the things you require.
    2. Yes

提交回复
热议问题