Bad practice to declare names in the standard namespace?

前端 未结 5 706
轻奢々
轻奢々 2021-01-18 02:15

I was looking through the Google C++ style guide, and came across this:

\"Do not declare anything in namespace std, not even forward declarations of standard library

5条回答
  •  一生所求
    2021-01-18 03:01

    This is saying not to declare your own types in the std namespace. You can use the standard library, but you should do so by including the appropriate header.

    Basically, make sure all of your declarations are in your own namespace, not std.

提交回复
热议问题