You can use pointer arithmetic to find the index of a specific element that std::remove_if
passes to the predicate:
std::remove_if(data.begin(), data.end(),
[&data](const double& d) { return (&d - &*data.begin()) % 2); });
Note that remove_if passes the result of dereferencing an iterator, and that's guaranteed to be a reference
per Table 106 - Iterator requirements in the Standard.