J
Javier
Hi all,
I have this code:
class A
{
std::list<B> m_observadores;
void function()
{
ApplySendMessage apply(this, message);
std::for_each(m_observadores.begin(),
m_observadores.end(),
apply);
}
}
and, ApplySendMessage:perator() adds a new item to the list
m_observadores under some conditions.
I get (MSVC8.0) "list iterator not incrementable" in an iteration of
for_each algorithm after adding (m_observadores.push_back) a new item
to the list in the previous iteration (ApplySendMessage =
AplicarEnviarMensaje):
msvcp80d.dll!std::_Debug_message(const wchar_t * message=0x005fbf30,
const wchar_t * file=0x005fbb50, unsigned int line=236) Línea 24 C++
std::for_each<std::list<maevif::cliente::ObservadorGestorEntidades
bytes C++
Is the iterator invalidated after the insertion or my error comes from
another place? Is this standard?
m_observadores.push_front instead of m_observadores.push_back will fix
that?
Thank you.
I have this code:
class A
{
std::list<B> m_observadores;
void function()
{
ApplySendMessage apply(this, message);
std::for_each(m_observadores.begin(),
m_observadores.end(),
apply);
}
}
and, ApplySendMessage:perator() adds a new item to the list
m_observadores under some conditions.
I get (MSVC8.0) "list iterator not incrementable" in an iteration of
for_each algorithm after adding (m_observadores.push_back) a new item
to the list in the previous iteration (ApplySendMessage =
AplicarEnviarMensaje):
msvcp80d.dll!std::_Debug_message(const wchar_t * message=0x005fbf30,
const wchar_t * file=0x005fbb50, unsigned int line=236) Línea 24 C++
libcliente.dll!std::list<maevif::cliente::ObservadorGestorEntidadeslibcliente.dll!std::list<maevif::cliente::ObservadorGestorEntidades *,std::allocator<maevif::cliente::ObservadorGestorEntidades *> >::_Const_iterator<0>:perator++() Línea 236 + 0x17 bytes C++
libcliente.dll!::_Iterator<0>:perator++() Línea 399 C++
std::for_each<std::list<maevif::cliente::ObservadorGestorEntidades
::_Iterator<1>,maevif::cliente::AplicarEnviarMensaje>(std::list<maevif::cliente::ObservadorGestorEntidades
std::list<maevif::cliente::ObservadorGestorEntidades::_Iterator<1> _First=0x0249b93c,
maevif::cliente::AplicarEnviarMensaje _Func={...}) Línea 28 + 0x8::_Iterator<1> _Last=0xcdcdcdcd,
bytes C++
Is the iterator invalidated after the insertion or my error comes from
another place? Is this standard?
m_observadores.push_front instead of m_observadores.push_back will fix
that?
Thank you.