I want to put edge label but facing an error. Please share any better idea.
Thanks in advance.
BTW, you shouldn't add things to the boost namespace; property names don't
need to be in that namespace. Anyway, the code worked for me with GCC
4.6. Here's the full test program I used:
#include
#include
#include <string>
#include <iostream>
struct plComputableObject;
struct slScoreValueType {};
namespace boost {
struct computable_object_t
{
typedef vertex_property_tag kind;
};
}
typedef boost::property > slVertexProperty;
typedef boost::property > slEdgeProperty;
typedef boost::adjacency_list slGraph;
int main(int, char**) {
using namespace boost;
slGraph graph;
//Now i want to add edge name
boost::property_map::type labelmap =
get(edge_name, graph);
boost::graph_traits<slGraph>::edge_iterator ei, ei_end;
for(tie(ei, ei_end) = edges(graph); ei != ei_end; ++ei){
std::string label = "unknown";
put(labelmap, *ei, label);
std::cout<<"\nUndirected s: "<