0

Maybe it's my configuration problem but... My Eclipse shows error when i'm trying to do sth like this:

// let say that i have a vector like this:

std::vector<Point2f> someVec(/*init vector or sth...*/);

and i want to read a field or whatever like this:

someVec[0].x = 10;

but then Eclipse cry that it's error - x is not a property. Moreover sth like this is "invalid" too:

// both are 'invalid'
someVec.operator[](0);
// or 
someVec.at(0);

On the other hand I can do sth like this and now Eclipse doesn't see any problem:

Point2f& p = someVec[0];
p.x = 10;

This 'hack' works well:

someVec.data()[0].x;

Have ever had similar problem maybe?

Michal W
  • 793
  • 8
  • 24
  • 1
    It's not a solution, but it may help: http://stackoverflow.com/a/16891713/192373 – Alex Cohn Jan 10 '14 at 18:28
  • Well... Now i have not compilation error - it's good :) but sadly it's not the best solution coz Eclipse still doesn't show me code hints when using dot or arrow when using [] operator. – Michal W Jan 10 '14 at 19:17
  • 1
    See my answer here http://stackoverflow.com/a/22935387/1525238 for complete indexing capability. – Ayberk Özgür Apr 08 '14 at 11:27

1 Answers1

0

I found an answer. I included stddef.h which define size_t and some other stuff. Now problem is solved.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Michal W
  • 793
  • 8
  • 24