[Lemon-user] Create and initialize a vector of NodeMaps (or ArcMaps)
David Franz Koza
dakoz at dtu.dk
Tue Jan 24 12:51:36 CET 2017
Hi Marco,
of course, not the first time I forget... thanks!
Best regards,
David
From: Lemon-user [mailto:lemon-user-bounces at lemon.cs.elte.hu] On Behalf Of Marco Blanco
Sent: 24. januar 2017 11:49
To: lemon-user at lemon.cs.elte.hu
Subject: Re: [Lemon-user] Create and initialize a vector of NodeMaps (or ArcMaps)
Dear David,
std::vector requires its elements to be copyable, like all STL containers. As the error message says, NodeMap doesn't have a copy constructor, so you cannot store them in a vector.
I don't know if there is a built-in alternative in Lemon, but what you can always do in these cases is to use a vector of pointers to NodeMap.
Kind regards,
Marco
Am 24.01.2017 um 11:16 schrieb David Franz Koza:
Dear all,
I would like to create a vector of NodeMaps. The size of the vector is not a constant, hence I tried the following to initialize the vector:
GraphClass::GraphClass(unsigned int num_maps) :
vec_of_maps(num_maps, lemon::SmartDigraph::NodeMap<bool>(g))
{
}
with
class GraphClass {
public:
GraphClass(unsigned int num_maps);
lemon::SmartDigraph g;
std::vector<lemon::SmartDigraph::NodeMap<bool>> vec_of_maps;
};
However, I get the following MSVC error:
Microsoft Visual Studio 14.0\VC\include\xmemory0(737): error C2280: 'lemon::DigraphExtender<lemon::SmartDigraphBase>::NodeMap<bool>::NodeMap(const lemon::DigraphExtender<lemon::SmartDigraphBase>::NodeMap<bool> &)': attempting to reference a deleted function
Any suggestions on how I can initialize a vector of lemon::SmartDigraph::NodeMap<bool>(g) ?
Thanks!
_______________________________________________
Lemon-user mailing list
Lemon-user at lemon.cs.elte.hu<mailto:Lemon-user at lemon.cs.elte.hu>
http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20170124/bd1e09ac/attachment.html>
More information about the Lemon-user
mailing list