Multi Index Container ordered index - infinte loop when advancing iterator which is the end iterator

View: New views
3 Messages — Rating Filter:   Alert me  

Multi Index Container ordered index - infinte loop when advancing iterator which is the end iterator

by Avi Revivo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

Is this a known issue that if due to a wrong usage the .end iterator is advanced there is an infinte loop?

Thanks in advance,
Avi Revivo

Re: Multi Index Container ordered index - infinte loop when advancing iterator which is the end iterator

by Felipe Magno de Almeida :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Dec 12, 2007 2:17 PM, Avi Revivo <revivoavi@...> wrote:
>
> Hi All,
>
> Is this a known issue that if due to a wrong usage the .end iterator is
> advanced there is an infinte loop?

Advancing an end iterator invokes undefined behavior.

> Thanks in advance,
> Avi Revivo
> --
> View this message in context: http://www.nabble.com/Multi-Index-Container-ordered-index---infinte-loop-when-advancing-iterator-which-is-the-end-iterator-tp14298293p14298293.html
> Sent from the Boost - Dev mailing list archive at Nabble.com.

--
Felipe Magno de Almeida
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Multi Index Container ordered index - infinte loop when advancing iterator which is the end iterator

by Joaquin M Lopez Munoz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Avi Revivo <revivoavi <at> hotmail.com> writes:

> Hi All,
>
> Is this a known issue that if due to a wrong usage the .end iterator is
> advanced there is an infinte loop?

Hello Avi,

As Felipe remarks, advancing end() is illegal, and anything
can happen if you perform an illegal operation. You can detect
this and other wrong usages of Boost.MultiIndex in a more
convenient fashion by using the provided safe mode:

http://boost.org/libs/multi_index/doc/tutorial/debug.html#safe_mode

HTH,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost