Boost logo

Boost Users :

Subject: Re: [Boost-users] Fwd: [BGL] wrapping bundled properties
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-05-04 14:43:27


On Fri, 3 May 2013, Sandeep Gupta wrote:

> Hi,
>
> I have my own container and define a wrapper around it to make it behave like a BGL graph. Is it possible (and does it make sense) to define wrapper for
> bundled properties i.e. I want to control the storage of the bundled properties but want the expression to evaluate
>
>    G[n].color = white
>
> As of now, I will just get an error operator [] not defined. It is quite that I just need to define operator 
> [] for G. Thanks in advance for any suggestions.

The main thing if you just want that syntax is that you would need to have
operator[] in your graph type. Getting full bundled property support
would including allowing syntax such as get(&vertex_prop::color, G) and
such; those are somewhat more difficult. If you do not need full
compatibility with all of the bundled property features, though,
operator[] is enough to implement.

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