After following the steps in this post I managed to make Eclipse (Indigo) recognize unique_ptr
(and other C++11 new stuff). The problem is that operator->
for unique_ptr
seems not to be supported in Eclipse. Here you have an example:
class Foo { void bar() { /* ... */ } };
std::unique_ptr<Foo> foo;
(*foo).bar(); // 1
foo->bar(); // 2
Case 1
works as expected: there is no error and autocompletion works. For case 2
, however, Eclipse marks the statement with an error ("Method 'bar' could not be resolved"), plus autocompletion from foo->
does not work.
Most interestingly, I do not have any problems with std::shared_ptr
. It only happens for std::unique_ptr
.
Has anyone experienced the same problem? Does anyone know a way to fix it?
EDIT: just for clarifying purposes, the compilation process goes fine for the code snippet shown above. So, the problem is not in the compiler itself, but on Eclipse.