How can I make SourceInsight understand smart pointers?

1.1k Views Asked by At

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;
}

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

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

1

There are 1 best solutions below

1
sehe On

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

Now, I can make SourceInsight import the symbols from the Boost directories: enter image description here

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

Processing takes a minute or two:

enter image description here

Seems ok:

enter image description here


Now if you import these symbols in your project:

enter image description here

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

enter image description here

But it will not find references to fun:

enter image description here

Finds only the declaration:

enter image description here

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

Here's the HTML export: https://s3.amazonaws.com/stackoverflow-sehe/f14b4ee2-9b4d-49cd-893d-cf69372dd586/HTML/test.cpp.html

enter image description here

Conclusion

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