Boost logo

Boost Users :

From: Douglas Gregor (dgregor_at_[hidden])
Date: 2007-09-11 09:32:09


Hello Andreas,

Andreas Fabri wrote:
> I adapt my own graph like data structures. They form a derivation hierarchy,
> and they are all in the same graph category.
>
> In order to avoid that I have to repeat the specializations of the
> graph traits, I put all the types needed in the base class, so
> the default graph traits, which just takes the types out of the class
> it is applied to, will get them from the base class or via inherited
> types from the base class.
>
Okay.
> What can I do in order to repeat the definition of the functions
> source(..), target(..) etc.
>
> I could tell my users to downcast but that's not nice. I also
> could have #defines for all my classes so that I write the code
> only once, but all these solutions are not appealing.
>
You should be able to write source, target, etc. in terms of the base
class. Several of the BGL's own graph data types do this, too.

    - Doug


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