My C++ overloading does not act as I assume it should:
#include \"Node.h\"
#include
Node::Node()
{
cout << \"1\" << endl;
In a nutshell:
#include
#include "Node.h"
Node::Node()
: game(Game()), value(0.), numVisits(0)
{
std::cout << "1" << std::endl;
}
Node::Node(double v)
: game(Game()), value(v), numVisits(0)
{
std::cout << "2" << std::endl;
}
Node::Node(Game g, double v)
: game(g), value(v), numVisits(0)
{
std::cout << "3" << std::endl;
}
As everyone said, you cannot call a constructor overload from a constructor. Delegation is an upcomming feature we'll meet with C++11. It's not much text to type, don't be lazy.