如何使SourceInsight理解智能指针? [英] How can I make SourceInsight understand smart pointers?

查看:611
本文介绍了如何使SourceInsight理解智能指针?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的代码使用智能指针,则导航和完成功能不适用于SourceInsight.例如,使用以下简单示例代码:

If my code uses smart pointers, navigation and completion don't work with SourceInsight. For example with this simple example code:

class test {
public:
    void fun(){}
};

int main() {
    boost::scoped_ptr<test> a;
    a->fun();
    return 0;
}

当我单击main中的fun()时,SourceInsight会告诉我未找到符号" .

When I click fun() in main , SourceInsight tells me "symbol not found".

我应该做些什么来解决此问题,还是SourceInsight有局限性?

Is there something I should do to fix that, or does SourceInsight have limitations?

推荐答案

因此,我尝试了一下.下载,病毒扫描,注册免费试用版,安装葡萄酒,运行!

So I've given this a try. Downloaded, virus-scanned, signed up for free trial, installed wine, run!

现在,我可以使SourceInsight从Boost目录中导入符号:

Now, I can make SourceInsight import the symbols from the Boost directories:

然后我输入我的Boost目录的路径:Z:\home\sehe\custom\boost\

I then enter the path to my Boost directory: Z:\home\sehe\custom\boost\

处理过程需要一到两分钟:

Processing takes a minute or two:

似乎还可以:

现在,如果您在项目中导入这些符号:

Now if you import these symbols in your project:

您将发现您可以导航到boost::scoped_ptr<>就好了(我在a声明中双击a):

You will find you can navigate to boost::scoped_ptr<> just fine (I double-clicked on the a in the declaration of a):

但是找不到对fun的引用:

仅查找声明:

您当然可以使用简单的字符串搜索,但这不是重点.

Of course you can use simple string search, but that wasn't the point.

这是HTML导出:

这似乎是SourceInsight的局限性,而不是由于配置错误所致.

It seems this is a limitation of SourceInsight, not due to misconfiguration.

这篇关于如何使SourceInsight理解智能指针?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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