I have the following 2 functions in my code:
bool num()
{
return 0;
}
void setDFS()
{
int i = 0;
project3::Graph<string, string> g1;
std::for_each(g1.Vertice1.begin(), g1.Vertice1.end(),num);
}
What the function does is for each Vertice in vector Vertice1, it has to set its number to 0 for now. Once I start graph traversing, later on I would be incrementing the num to the traversed count.
While compiling, I am getting ”
error C2197: ‘bool (__cdecl *)(void)’ : too many arguments for call” error.
template <class VertexType, class EdgeType> class Vertex{
protected:
VertexType vertice;
EdgeType edge;
public:
};
std::vector<project3::Vertex<VertexType, EdgeType>*> Vertice1;
for_each algorithm receives a unary function which should have the following signature:
where T is the type of element of g1.Vertice1 vector: