Boost logo

Boost Users :

From: Elvanör (elvanor2004_at_[hidden])
Date: 2005-03-19 16:16:23


In addition to my last question, I wonder what are the type
requirements for the bundled properties. Because I've had quite a few
compiler errors, and as far as I can tell from these errors, it seems
to me that a type used for bundled properties must be (at least)
Assignable, and (that's even stranger for me) Default Constructible,
since I had complains about missing default constructors and member
references (which are not assignable).

Can someone confirms this is true? If yes, this should also be
documented somewhere...

Jean-Noël Rivasseau

ps: I have almost no idea of how a graph is stored (internally) when
using the BGL. But the errors seem to be linked with the type of
containers chosen for the vertex and out-edges list (in an
adjacency_list class). For example I had these errors when using vecS,
but if I switch to mapS, I have only the Default Constructible error
(not the Assignable requirement, strange...)

So the bundled properties are also stored depending on the containers
you choose?

(as for my previous question, I realised after all that, that it's
maybe not a good idea to have references as bundled properties, as they
seem to be stored in containers, and having references in containers of
the STL is a bad thing (because, once again, they are not Assignable).
Any comments?)

> Hi.
>
>
>>> Any help would be appreciated, and I still think the documentation
>>> should mention how to get the type of the bundled properties.
>>
>> You're absolutely correct. I've just added the aforementioned traits
>> with some documentation for them (within the description of bundled
>> properties).
>
> I guess all of this is in the CVS, of course... I wondered also if
> there was a way to download all of the boost documentation (HTML
> format) for offline browsing, rather than going to the web site every
> time (maybe this is intentionalk though). I mean, a way different than
> downloading the CVS documentation.
>
> I have yet a new question: is it possible to have, as a bundled
> property, references to objects and not just the object themselves ?
>
> IE,
>
> typedef adjacency_list<mapS, vecS, undirectedS, myClass > Graph;
>
> works, but I can't manage to have:
>
> typedef adjacency_list<mapS, vecS, undirectedS, myClass &> Graph;
>
> (A pointer, though, is ok as I have noted on one of my earlier mails).
>
> I have noted, though, that function such as
> add_vertex(const VertexProperties& p, adjacency_list& g) do take a
> reference to a VertexProperties. So should I assume that if I
> construct my graph in this way (via use of add_vertex, etc...) my
> bundled properties will just be references, ie, no copy construction
> will occur ( and after running my graph algorithms, the modifications
> on the bundled properties will still be accessible)?
>
> Jean-Noël
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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