Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Out-of-range Edge Endpoints
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2010-04-29 15:06:47


>
>
>> 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.
>

In the case of the constructor, it may. In the case of add_edge (with the
vertex list == vecS), adjacency_list will automatically resize -- I think I
remember being surprised with this before :) It's probably worth looking at
before taking my word for it.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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