错误:insertor不是std的成员

Error: insertor is not a member of std

本文关键字:成员 std 不是 insertor 错误      更新时间:2023-10-16

代码如下:

#include<set>
#include<iterator>
some_func()
{
     std::set_difference(s1.begin(), s1.end(), s2.begin(),s2.end(),std::insertor(myresult,myresult.begin()));
}

它给了我一个错误:

Error: insertor is not a member of std.

该函数命名为std::inserter,而不是std::insertor

使用std::inserter,不是std::insertor