
  template &lt;class Name&gt;
  class label_writer {
  public:
    label_writer(Name _name) : name(_name) {}
    template &lt;class VertexOrEdge&gt;
    void operator()(std::ostream&amp; out, const VertexOrEdge&amp; v) const {
      out &lt;&lt; "[label=\"" &lt;&lt; name[v] &lt;&lt; "\"]";
    }
  private:
    Name name;
  };
</pre>

<p>
A function to conveniently create this writer is provided:
<pre>
template &lt; class Name &gt;
label_writer&lt;Name&gt;
make_label_writer(Name n);
</pre>

<p>
A <a href=".