[Lemon-user] Create and initialize a vector of NodeMaps (or ArcMaps)
Marco Blanco
blanco at zib.de
Tue Jan 24 11:48:57 CET 2017
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 intnum_maps) :
>
> vec_of_maps(num_maps, lemon::SmartDigraph::NodeMap<bool>(g))
>
> {
>
> }
>
> with
>
> classGraphClass{
>
> public:
>
> GraphClass(unsigned intnum_maps);
>
> lemon::SmartDigraphg;
>
> 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
> 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/78518b2c/attachment.html>
More information about the Lemon-user
mailing list