[cedet-semantic] Smart pointer completion...
Brought to you by:
zappo
From: Ben M. <mon...@us...> - 2010-02-23 06:02:14
|
Hi, I notice on the Cedet website that there is good support for smart pointers. Ultimately, I'd love to use cedet when working on the libferris codebase, which uses the Modern C++ Design policy based smart pointers fairly heavily. I've managed to get completions working for classes and bare pointers, but seem to be having problems taking it to the next level. For example, in the following code the std::vector has completions, and the speedbar in analyze mode shows them when you leave the cursor on the clear() method call. The raw pointer to a foo also works, both bar and barry are shown as completions when hovering over bar(). Unfortunately, none of the smart pointers (auto_ptr and Loki::SmartPtr) want to play ball. I realize that the fh_foo might require some tinkering to the spp-table to get working. The *Messages* buffer contains this: semantic-analyze-possible-completions-default: Cannot find types for `std::auto_ptr fooap' Cannot find types for `std::auto_ptr fooap' [3 times] Any hints on what I'm doing wrong here would be wonderful. #include <string> #include <vector> #include <backward/auto_ptr.h> #include <memory> class foo { public: int bar(); std::string barry(); }; int foo::bar() { return 0; } std::string barry() { return ""; } #include <FerrisLoki/Extensions.hh> #define FERRIS_SMARTPTR( ClassName, HandleName ) \ typedef Loki::SmartPtr< ClassName, \ Loki::RefLinked, \ Loki::DisallowConversion, \ FerrisLoki::FerrisExSmartPointerChecker, \ FerrisLoki::FerrisExSmartPtrStorage > HandleName; FERRIS_SMARTPTR(foo,fh_foo); int main( int argc, char** argv ) { std::vector<int> v; v.clear(); foo* rawp; rawp->bar(); std::auto_ptr<foo> fooap; fooap->ba Loki::SmartPtr<foo> fooj; fooj->bar(); fh_foo z; z->bar(); return 0; } |