I have the following code (compiler: MSVC++ 10):
std::vector data; data.push_back(1.0f); data.push_back(1.0f); data.push_back(2.0f); // lambda
maybe in the lambda function, pass it a int& instead of value int, so you'd have the address. & then you could use that to deduce your position from the first item
int&
would that work? i don't know if for_each supports references