为什么Visual Studio的intellisense显示私有成员和函数? [英] Why does Visual Studio's intellisense show private members and functions?

查看:124
本文介绍了为什么Visual Studio的intellisense显示私有成员和函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中使用本机c ++时,intellisense显示私有成员和函数,即使在包含类的范围之外。这使得很难为我写的类创建干净的API。

When working with native c++ in Visual Studio, intellisense shows private members and functions even when outside the scope of the containing class. This makes it hard to create clean APIs for the classes I write.

有这样的原因吗?

推荐答案

那么,为什么不应该显示私有的呢?他们是成员,毕竟,他们存在,他们是完全可访问从某些情况下,就像任何其他成员。

Well, why shouldn't it show the private ones as well? They are members, after all, they exist and they are perfectly accessible from certain contexts, just like any other members.

IntelliSense很难确定成员是否可以从这个特定的上下文中访问,特别是如果你考虑到在大多数情况下这个上下文是尚未完成(用户仍在输入),这意味着通常无法对其进行分析。

It would be very difficult for the IntelliSense to determine whether the members are accessible or not from this specific context, especially if you take into account that in most cases this context is not yet complete (the user is still typing it up), meaning that it is generally impossible to analyze it.

这篇关于为什么Visual Studio的intellisense显示私有成员和函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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