C++编译.cpp文件,出现错误:
vector.h: In function ‘void sxl::test_vector3()’:
vector.h:242:57: error: no matching function for call to ‘find(sxl::vector<int>::iterator, sxl::vector<int>::iterator, int)’
vector<int>::iterator pos = find(v.begin(),v.end(),3);
^
vector.h:242:57: note: candidate is:
In file included from /usr/include/c++/4.8.2/bits/locale_facets.h:48:0,
from /usr/include/c++/4.8.2/bits/basic_ios.h:37,
from /usr/include/c++/4.8.2/ios:44,
from /usr/include/c++/4.8.2/ostream:38,
from /usr/include/c++/4.8.2/iostream:39,
from vector.h:1,
from vector.cpp:1:
解决方法:
添加一个头文件#include