#include <vector>
class Foo
{
public:
void DoSomething();
private:
struct Bar
{
int mMember1;
int mMember2;
Bar() : mMember1(), mMember2() {}
};
std::vector<Bar> mBars;
};
void Foo::DoSomething()
{
Bar bar1;
mBars.push_back(bar1);
bar1.mMember1 = 0;
mBars[0].mMember1 = 0;
}
int main()
{
Foo foo1;
foo1.DoSomething();
return 0;
}
jens@debian-inspiron:/tmp/test$ clang++ -w -fsyntax-only -Xclang -code-completion-at=main.cpp:28:14 main.cpp
COMPLETION: Bar : Bar::
COMPLETION: mMember1 : [#int#]mMember1
COMPLETION: mMember2 : [#int#]mMember2
COMPLETION: operator= : [#struct Foo::Bar &#]operator=(<#struct Foo::Bar const &#>)
COMPLETION: ~Bar : [#void#]~Bar()
jens@debian-inspiron:/tmp/test$
2) if you type "mBars[0]." --> NO completion kicks in : NOT OK
mBars[0].
[0]
p mBars[0].Value
A single unified parser for C, Objective C, C++, and Objective C++
Clang is the "C Language Family Front-end", which means we intend to support the most popular members of the C family. We are convinced that the right parsing technology for this class of languages is a hand-built recursive-descent parser. Because it is plain C++ code, recursive descent makes it very easy for new developers to understand the code, it easily supports ad-hoc rules and other strange hacks required by C/C++, and makes it straight-forward to implement excellent diagnostics and error recovery.
We believe that implementing C/C++/ObjC in a single unified parser makes the end result easier to maintain and evolve than maintaining a separate C and C++ parser which must be bugfixed and maintained independently of each other.
autually operator [] has been supported for a long time,you guys can write some codes to test it.
the vector doesn't work because of the class[vector] inheritance is not built. I should do this a long ago.
but recently I am quite losing my time.sorry.