Boost logo

Boost :

From: Cromwell Enage (sponage_at_[hidden])
Date: 2004-10-20 21:01:22


--- "David M. Jones" <djones_at_[hidden]> wrote:
> Hello all,

Hello, David.

> If I have an adjacency_list g and I call
> g = g;
> all of the vertices and edges of g are removed. This
> is not what I would expect; I would expect that this
> operation would not change g.

Oooh, aliasing...

> 1. Is this the desired behavior? (It seems different
> than what other types do.)

Looking at <boost/graph/detail/adjacency_list.hpp>, I
see that the member operator=, before copying, clears
its owner of its vertices and edges without first
checking if *this != g. (Basic question: is such
checking possible? I tried a couple of times without
success.) This is true for both subclasses of
detail::adj_list_helper. Not sure if it's desired,
though.

> 2. Is this issue old news? (I couldn't find it on
> the mailing list archives but it may well be there.)

I'm curious as to where one would use g = g.

                              Cromwell Enage

                
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk