Boost logo

Boost Users :

Subject: [Boost-users] BGL, swap or move graphs
From: Paolo Bolzoni (paolo.bolzoni.brown_at_[hidden])
Date: 2015-12-01 21:47:14


Dear list,

I am writing a program where I create a graph first and I want to put
it inside another class instance (type T). The idea is to keep the two
steps separated as possible.

Normally, sure-fire way was using swap. Inside the class T you create
a default object and swap it with the real one on initialization; this
avoids needless copies and just construct a small object.

Nowadays, it is also possible to use moveable objects to even avoid
that object creation.

This is nice and I (think I) understood it, but it is possible to do
anything like this with boost graphs? Graphs don't model Assignable,
so swap is not possible, and I could not find anything about being
Moveable either.

Is there really no way to accomplish a swap or a move? I just have to
create the graph in the beginning, and keep a reference, or pointer,
to it?

Cheers,
Paolo


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