I have this function, order
, which returns vector<Node*>
vector<Node*> order(vector<string> nodes, vector<pair<string, string>> dependencies) {
Graph graph = buildGraph(nodes, dependencies);
vector<Node*> order = buildOrder(graph.getNodes());
return order;
}
and I call it like this:
vector<Node*> order2 = order(nodes, deps);
However, the compiler gives this error:
error: type 'std::__1::vector<Node *, std::__1::allocator<Node *> >' does not provide a call operator
vector<Node*> order2 = order(nodes, deps);
^~~~~
1 error generated.
What is going wrong? 'std::__1::vector<Node *, std::__1::allocator<Node *> >'
seems to suggest that there is a vector<Node*, <Node*>>
or something going on, but I can't seem to figure this out.
It's a bit hard to tell without your posting more complete code, but consider the following:
int order(int j, int k)
{
return 3;
}
int main(int argc, char *argv[])
{
char order;
// order(2, 3);
}
This code builds fine. However, uncommenting
// order(2, 3);
causes it to fail, as within main
, order
is a character, not a function. From the error message, it looks like you might have some similar problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With