【发布时间】:2014-08-25 16:22:00
【问题描述】:
int nums[] = { 4096,64,55,23,544,23,44,556,75,33,23,23};
//nums + sizeof(nums)/sizeof(int)
pair<vector<int>::iterator,int*> pr;
pr = mismatch (p6store.begin(),p6store.end(),nums); //ERROR HERE
C:\WS8_SRV\server_aplt\src\include\c++\3.4.2\bits\stl_pair.h 在构造函数中 `std::pair<_t1 _t2>::pair(const std::pair<_u1 _u2>&) [with _U1 = __gnu_cxx::__normal_iterator >>, _U2 = int*, _T1 = __gnu_cxx::__normal_iterator >>, _T2 = int*]':
90 C:\WS8_SRV\server_aplt\src\include\c++\3.4.2\bits\stl_pair.h 没有匹配函数调用`__gnu_cxx::__normal_iterator >>::__normal_iterator(const __gnu_cxx::__normal_iterator >> &)'
我不明白那个 sn-p 有什么问题
我已经包含了向量、实用程序和算法。
谢谢
编辑:完整代码
vector<unsigned long long int> p6store(350);
init_sq_generator(0);
generate(p6store.begin(),p6store.end(),sq_generator);
for_each(p6store.begin(),p6store.end(),print_val);
int nums[] = { 4096,64,55,23,544,23,44,556,75,33,23,23};
【问题讨论】:
-
p6store是什么?mismatch是什么?换句话说,发布MCVE。 -
那个 sn-p 不完整。例如 p6store 没有定义。这就是那个 sn-p 的问题。
-
Can I use mismatch to compare vector which stores ull(unsigned long long) int with an normal int arrayvector<T>和vector<U>或U的数组是两种不同的类型。T和U是否具有相似的属性(即整数)并不重要。