[Lemon-user] Class delcaration

Alpár Jüttner alpar at cs.elte.hu
Wed Jan 5 18:57:53 CET 2011


On Wed, 2011-01-05 at 11:53 -0500, Ethan Kim wrote:
> Hi,
> 
> I'm new to lemon graph library, and I have a simple problem. I'm
> declaring a graph class that contains lemon's ListGraph class,
> together with NodeMap as a member variable.
> 
> 
> class Network {
> public:
> 	Network();
> 	virtual ~Network();
> private:
> 	ListGraph g;
> 	ListGraph::NodeMap<string> vname;
> };
> 
> But when I define a constructor as below:
> 
> 
> Network::Network() {
> 	vname = new ListGraph::NodeMap<string>(g);
> }
> 
> The compiler complains that there is no constructor:
> 
> no matching function for call to
> 'lemon::GraphExtender<lemon::ListGraphBase>::NodeMap<std::string>::NodeMap()'.
> 
> Is there an obvious step I'm missing here?

Yes, there is. You should declare vname to be a pointer:

ListGraph::NodeMap<string> *vname;

Regards,
Alpar





More information about the Lemon-user mailing list