OmniCppComplete: Completing on Class Members which are STL containers

Posted by Robert S. Barnes on Stack Overflow See other posts from Stack Overflow or by Robert S. Barnes
Published on 2010-05-16T08:53:56Z Indexed on 2010/05/17 9:30 UTC
Read the original article Hit count: 245

Filed under:
|
|
|
|

Completion on class members which are STL containers is failing.

Completion on local objects which are STL containers works fine.

For example, given the following files:

// foo.h
#include <string>

class foo {
public:
    void 
    set_str(const std::string &);

    std::string
    get_str_reverse( void );

private:
    std::string str;
};

// foo.cpp
#include "foo.h"

using std::string;

string
foo::get_str_reverse ( void )
{
    string temp;

    temp.assign(str);
    reverse(temp.begin(), temp.end());

    return temp;
}       /* -----  end of method foo::get_str  ----- */

void
foo::set_str ( const string &s )
{
    str.assign(s);
}       /* -----  end of method foo::set_str  ----- */

I've generated the tags for these two files using:

ctags -R --c++-kinds=+pl --fields=+iaS --extra=+q .

When I type temp. in the cpp I get a list of string member functions as expected. But if I type str. omnicppcomplete spits out "Pattern Not Found".

I've noticed that the temp. completion only works if I have the using std::string; declaration.

How do I get completion to work on my class members which are STL containers?

© Stack Overflow or respective owner

Related posts about vim

Related posts about ctags