在我的代码中出现“ {”令牌”之前,错误“在此不允许函数定义”。 那我该如何解决呢?
void strongconnect(std::unordered_set<vertex>& v, const
directed_graph<vertex>& d, std::vector<std::vector<vertex>>&
scc, std::stack<vertex>& S, std::unordered_set<vertex,
bool>& on_stack,std::unordered_map<vertex, int>& index,
std::unordered_map<vertex, int>& low, int& count)
{ // the error occured this line
int index = 0;
d = d.vertices;
vector<int> s;
for (auto v : d)
{
if(index[v] is undefined) // I don't know how to write this 'index[v] is undefined' code
{
strongconnect(v, d, scc, S, on_stack, index, low, count);
}
}
}