Look at the following code, as you it print out:
-----------
name: graph
name sg1: subgraph 3
name sg2: subgraph 3
name sg3: subgraph 3
-----------
when I waiting for
-----------
name: graph
name sg1: subgraph 1
name sg2: subgraph 2
name sg3: subgraph 3
-----------
WHY?
Is this a bug in the library?
#include <string>
#include <iostream>
using namespace std;
#include
#include
#include
#include
int main() {
boost::GraphvizDigraph gr;
boost::get_property(gr, boost::graph_name) = "graph";
std::cout << "name: " << get_property(gr, boost::graph_name) << std::endl;
boost::subgraph > sg1 = gr.create_subgraph();
get_property(sg1, boost::graph_name) = "subgraph 1";
boost::subgraph > sg2 = gr.create_subgraph();
get_property(sg2, boost::graph_name) = "subgraph 2";
boost::subgraph > sg3 = gr.create_subgraph();
get_property(sg3, boost::graph_name) = "subgraph 3";
std::cout << "name sg1: " << get_property(sg1, boost::graph_name) << std::endl;
std::cout << "name sg2: " << get_property(sg2, boost::graph_name) << std::endl;
std::cout << "name sg3: " << get_property(sg3, boost::graph_name) << std::endl;
}