in C++ 11 mode, methods on STL container elements cannot be parsed [message #965709] |
Wed, 31 October 2012 12:56 |
Peter Holzkorn Messages: 1 Registered: October 2012 |
Junior Member |
|
|
I'm using Eclipse Juno with CDT to develop my C++ project with custom makefile. I am also using C++11 features, enabled by adding '-std=c++11' in 'discovery options' and adding '__GXX_EXPERIMENTAL_CXX0X__' under 'paths and symbols'.
The problem is that with C++ 11 enabled, Eclipse is unable to parse methods or fields accessed on STL container elements. E.g.:
mainapp.h
typedef struct _PlayerCalibrationData {
[...]
std::string getSamplesStr()
{
[...]
}
} PlayerCalibrationData;
std::vector<MainApp::PlayerCalibrationData> m_calibrationData;
mainapp.cpp
m_calibrationData[0].getSamplesStr();
getSamplesStr() will be underlined and marked as an error, with the message "Method 'getSamplesStr' could not be resolved".
The compiler doesn't complain, though, regardless of whether I invoke it from Eclipse or from the command line.
Also, when I type m_calibrationData., all vector methods pop up via content assist (i.e. it's not an issue of Eclipse not finding the vector include), but as soon as I access an element via [] or at(), content assist is quiet and anything typed manually is marked as an error.
If I disable C++ 11 support, this problem doesn't appear - but then the parser obviously complains about 'unique_ptr's etc.
|
|
|
Powered by
FUDForum. Page generated in 0.02802 seconds