Unqualified name lookup: Why local declaration hides declaration from using directive

China☆狼群 提交于 2019-11-29 14:04:31

The key is 10.3.4/2 "During unqualified name lookup, the names appear as if they were declared in the nearest enclosing namespace which contains both the using-directive and the nominated namespace."

The nominated namespace is A, the using directive is in B, and the smallest (in fact only) common namespace is the global namespace. Thus i appears as if declared in the global namespace, and is hidden by B::i.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!