samedi 31 octobre 2015

forward_list::remove throwing compilation error

I have the following code:

typedef std::forward_list<RdidSettings> RdidList;
RdidList m_rdids;

//ctor for RdidSettings 
RdidSettings(_In_ const GUID& rdid, _In_ bool isDr) throw() :


//Add to rdidlist method 
RdidSettings& AddRdid(  _In_ const GUID& rdid,  _In_ bool isDr  ) 
{   
    m_rdids.emplace_front(rdid, isDr);  return m_rdids.front(); 
}


//method for rdid list method 
void RemoveRdid( _In_  RdidSettings& rdidData) 
{   
    m_rdids.remove(rdidData); <<-- whats wrong with this remove ? 
}

The moment I introduce the remove method I start getting compiler error :

forward_list(1281) : error C2678: binary '==' : no operator found which takes a left-hand operand of type RdidSettings' (or there is no acceptable conversion) could be 'bool std::operator ==(const std::error_condition &,const std::error_code &) throw()'

'bool std::operator ==(const std::error_condition &,const std::error_code &) throw()' 6> \sdk\inc\ucrt\stl120\system_error(406): or 'bool std::operator ==(const std::error_code &,const std::error_condition &) throw()' 6> \sdk\inc\ucrt\exception(333): or
'bool std::operator ==(const std::exception_ptr &,std::nullptr_t)' 6> \sdk\inc\ucrt\exception(328): or 'bool std::operator ==(std::nullptr_t,const std::exception_ptr &)' 6> \sdk\inc\ucrt\exception(323): or 'bool std::operator ==(const std::exception_ptr &,const std::exception_ptr &)' 6> while trying to match the argument list '(RdidSettings, const RdidSettings)' 6> \sdk\inc\ucrt\stl120\forward_list(1276) : while compiling class template member function 'void std::forward_list>::remove(const _Ty &)' 6> with 6> [ 6> _Ty=RdidSettings 6> ] 6> hostsettings.cpp(65) : see reference to function template instantiation 'void std::forward_list>::remove(const _Ty &)' being compiled 6> with 6> [ 6> _Ty=RdidSettings 6> ] 6> \hostsettings.h(181) : see reference to class template instantiation 'std::forward_list>' being compiled 6> with 6> [ 6> _Ty=RdidSettings

Aucun commentaire:

Enregistrer un commentaire