为什么'std'命名空间中没有'nullptr'? [英] Why isn't 'nullptr' in the 'std' namespace?

查看:273
本文介绍了为什么'std'命名空间中没有'nullptr'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎 nullptr 是在默认全局命名空间中声明的。 std 命名空间是否有意义?

解决方案

nullptr 是一个C ++ 11关键字(与无关,如果 public true void 等),因此命名空间不适用。 / p>

It seems that nullptr is declared in the default global namespace. Wouldn't it make sense for it to be in the std namespace?

解决方案

nullptr is a C++11 keyword (no different to if, public, true, void, etc.), so namespaces don't apply.

这篇关于为什么'std'命名空间中没有'nullptr'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆