重载 *** <unresolved overloaded function type>)' 的调用不明确

call of overloaded *** <unresolved overloaded function type>)' is ambiguous

请帮我解决这个错误

template <typename Inputlterator, typename Outputlterator, typename Predicate>
Outputlterator copy_if( Inputlterator begin, Inputlterator end, Outputlterator destBegin, Predicate p) 
{
    return remove_copy_if(begin, end,destBegin, not1( ptr_fun( p ) ) );
}
template <class T> bool is_not_3( T val ) {
    return val != 3;
}
void foo( ) {
    vector<int> v;
    v.push_back( 1 );
    v.push_back( 2 );
    v.push_back( 3 );
    copy_if( v.begin( ), v.end( ), ostream_iterator<int>( cout, " " ), is_not_3<int> );
}

我收到一条错误消息 : 错误:重载 'copy_if(std::vector::iterator, std::vector::iterator, std::ostream_iterator, )' 的调用不明确

重写此语句

copy_if( v.begin( ), v.end( ), ostream_iterator<int>( cout, " " ), //...);

喜欢

::copy_if( v.begin( ), v.end( ), ostream_iterator<int>( cout, " " ), //...);
^^^

否则你的函数与标准算法冲突std::copy_if

问题出现是因为你使用了derictive

using namespace std;

请注意,您的代码片段中的函数调用在语法上未完成。您忘记指定最后一个参数。