Linux中编译错误之——vector.h:250:57: error: no matching function for call to ‘find

2021/10/12 7:18:14

本文主要是介绍Linux中编译错误之——vector.h:250:57: error: no matching function for call to ‘find,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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



这篇关于Linux中编译错误之——vector.h:250:57: error: no matching function for call to ‘find的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程