Boost logo

Boost Users :

From: Douglas Gregor (dgregor_at_[hidden])
Date: 2005-02-11 22:49:08


On Feb 11, 2005, at 6:00 PM, Welson Sun wrote:
> template <typename Vertex>
> void operator()(std::ostream& out, Vertex& v) {
> out << "[label=\""
> << g[v].toString()
> << "\"]";
> [snip]
> template <typename Edge>
> void operator()(std::ostream& out, Edge& v) {
> out << "[label=\""
> << "E"
> << "\"]";
> }

I think it's a problem with the reference... typically, you just accept
vertex and edge descriptors by-value (not by-reference), because
they're small and cheap to copy. So the second operator() would start
with:

   template<typename Edge>
   void operator()(std::ostream& out, Edge v) {

        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