[ create a new paste ] login | about

Link: http://codepad.org/7VYELJan    [ raw code | fork ]

C++, pasted on Jun 6:
#include <iostream>
#include <string>

#include <boost/graph/undirected_graph.hpp>

typedef boost::property<boost::vertex_name_t, std::string> VertexProperty;
typedef boost::undirected_graph<VertexProperty> Graph;

int main(int,char*[])
{
  // Create a graph object
  Graph g(3);

  // Assign "Vertex0" as the name of the 0th vertex
  g[0] = "Vertex0";

  // Assign "Vertex0" as the name of the 0th vertex
  boost::property_map<Graph, boost::vertex_name_t>::type value = boost::get(boost::vertex_name_t(), g);
  boost::put(value, 0, "Vertex0");

  return 0;
}


Create a new paste based on this one


Comments: