: vector<void*> * lvalue . const vector<void*> & lvalues r. vector<void*> && rvalues.
Based on your question, your function makes sense to be called with lvalues or rvalues, so it const vector<void*> &is an obvious choice.
There is no way to indicate through the type system that the caller should stop using the contained pointers, and you should not try to indicate this through the type system. Indicate this through the documentation.
source
share