Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Out-of-range Edge Endpoints
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-04-29 13:44:49


On Thu, 29 Apr 2010, Hossein Haeri wrote:

> Dear all,
>
> In the following documentation page for adjacency_list:
>
> http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/adjacency_list.html
>
> according to what I read below the following ctor, endpoints of edges must all fall in [0, n):
>
> template <class EdgeIterator>
> adjacency_list(EdgeIterator first, EdgeIterator last,
> vertices_size_type n,
> edges_size_type m = 0,
> const GraphProperty& p = GraphProperty())
>
> What I can't see is what will happen when the endpoints don't fall in [0, n). Is that documented somewhere?

I don't think so. It's basically undefined behavior -- it usually ends up
in an out-of-bounds array access and thus likely a crash.

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net