I am trying to use Eclipse CDT (just for the 'organize includes' functionality) on OS X for a C++ project. The static analyzer (syntax highlighting) doesn't seem to be able to resolve the type of a template operator overload in container classes, such as std::vector and operator[]. Example:
#include <vector>
int main() {
std::vector<std::vector<int> > st = {{0}};
st[0].size(); // Method 'size' could not be resolved
st.front().size(); // no problem
}
This code compiles in g++ and clang++. I am not excited about turning off syntax highlighting completely (what's the point of the IDE?). Any ideas on getting Eclipse CDT (specifically Neon.3 Release (4.6.3) on OS X) to understand this?
EDIT: Updated with a simpler MWE, the problem was not related to using a struct.
EDIT: Added Eclipse CDT version.
typedef structin C++.struct st { int i; };would be just fine. - zett42