T
Thomas Mathew
Dear All,
I am trying to remove an entity from the vector but getting many error
messages. I know it is a casting problem but I don’t know how to fix
it.
Following is the code snippet.
bool CMdlMain::RemoveLayers()
{
bool result = false;
long index = m_oLayerListBox.Selected();
if (-1 < index) {
m_vecLayerList.erase (std::remove (m_vecLayerList.begin (),
m_vecLayerList.end (), m_vecLayerList[index]), m_vecLayerList.end
());
result = true;
}
return result ;
}
// Following is the vector declaration
typedef std::vector<std::wstring> Vector_Layers;
Vector_Layers m_vecLayerList;
// Following is the error
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\algorithm(43) :
error C2784: 'bool __cdecl std:perator ==(const class
std::istream_iterator<_U,_E,_Tr> &,const class
std::istream_iterator<_U,_E,_Tr> &)' : could not deduce template
argument
fo r 'const class std::istream_iterator<_U,_E,_Tr> &' from 'class
std::basic_string<unsigned short,struct std::char_traits<unsigned
short>,class std::allocator<unsigned short> >'
It would be a great help if anyone could kindly help me.
Thomas
I am trying to remove an entity from the vector but getting many error
messages. I know it is a casting problem but I don’t know how to fix
it.
Following is the code snippet.
bool CMdlMain::RemoveLayers()
{
bool result = false;
long index = m_oLayerListBox.Selected();
if (-1 < index) {
m_vecLayerList.erase (std::remove (m_vecLayerList.begin (),
m_vecLayerList.end (), m_vecLayerList[index]), m_vecLayerList.end
());
result = true;
}
return result ;
}
// Following is the vector declaration
typedef std::vector<std::wstring> Vector_Layers;
Vector_Layers m_vecLayerList;
// Following is the error
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\algorithm(43) :
error C2784: 'bool __cdecl std:perator ==(const class
std::istream_iterator<_U,_E,_Tr> &,const class
std::istream_iterator<_U,_E,_Tr> &)' : could not deduce template
argument
fo r 'const class std::istream_iterator<_U,_E,_Tr> &' from 'class
std::basic_string<unsigned short,struct std::char_traits<unsigned
short>,class std::allocator<unsigned short> >'
It would be a great help if anyone could kindly help me.
Thomas