L
lovecreatesbea...
The find() in <algorithm> requires two input iterators as its first and
second arguments. In some of my code, I use vector<T>::begin() and
vector<T>::end() as the first and second arguments. The T:perator==
and T:perator!= are defined. And the code works.
The begin() and end() of vector<T> are not input iterators but random
access iterators, right? Why I use find() on vectors, are there
something wrong?
Class OgFile{
friend operator == ();
friend operator != ();
//...
};
vector <OgFile> vecOgFile;
OgFile OgFile1;
//...
find (vecOgFile.begin(), vecOgFile.end(), OgFile1);
second arguments. In some of my code, I use vector<T>::begin() and
vector<T>::end() as the first and second arguments. The T:perator==
and T:perator!= are defined. And the code works.
The begin() and end() of vector<T> are not input iterators but random
access iterators, right? Why I use find() on vectors, are there
something wrong?
Class OgFile{
friend operator == ();
friend operator != ();
//...
};
vector <OgFile> vecOgFile;
OgFile OgFile1;
//...
find (vecOgFile.begin(), vecOgFile.end(), OgFile1);