Works!
typedef boost::adjacency_list
<boost::setS, boost::listS,
boost::undirectedS,
boost::no_property,
boost::no_property> Graph;
typedef boost::graph_traits<Graph>::vertex_iterator VertexIterator;
typedef boost::graph_traits<Graph>::vertex_descriptor VertexDesc;
typedef std::map<VertexDesc, size_t> VertexDescMap;
Graph graph;
...
VertexDescMap idxMap;
boost::associative_property_map<VertexDescMap> indexMap(idxMap);
VertexIterator di, dj;
boost::tie(di, dj) = boost::vertices(_graph);
for(int i = 0; di != dj; ++di,++i){
boost::put(indexMap, (*di), i);
}
std::map<VertexDesc, size_t> compMap;
boost::associative_property_map<VertexDescMap> componentMap(compMap);
boost::associative_property_map<VertexDescMap>& componentMap;
boost::connected_components(_graph, componentMap, boost::vertex_index_map(indexMap));