Boost logo

Boost Users :

From: Johan Oudinet (johan.oudinet_at_[hidden])
Date: 2005-11-21 17:41:49


On 11/21/05, Doug Gregor <dgregor_at_[hidden]> wrote:
>
> On Nov 21, 2005, at 8:31 AM, Johan Oudinet wrote:
>
> > Hello,
> >
> > I like the named parameter method to define graph properties, so all
> > our properties are concentrated in a struct. But, I'd like add a
> > vertex with specific properties are already defined:
> > [snip]
> > People n ("toto", 26);
> > v = add_vertex (g); // this use the default ctor of People, a
> > add_vertex(g, n)
> > g[v] = n; // will be more efficiently (avoid a
> > People assignment)
>
> You should be able to write:
>
> v = add_vertex(n, g);
>

 Yes, thanks (I got it just after posting my question... sorry).
Just if someone else find a way to use struct for properties without
default ctor, there is add_vertex (np, g) and add_edge(u, v, ep, g).
I found it in the BGL book.

Regards,

--
Johan

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