Say I have a function:
void someFunc(int *x,int count);
which is out of my control, so I can't write it to accept iterators.
Is it safe to call it like so (regardless of the specific STL implementation):
vector<int> v;
/* ... */
someFunc(&v[0],v.size());
Obviously, one counter example is vector<bool>
. How about any other type? (assuming I haven't specialized vector
in any way).