Guesser::Guesser() { //at this line: [error] no matching function for call to 'Thing::Thing()'
Thing thing(string("rock"));
thing._Question.push_back(Question("Is it alive? ", 'N'));
Memory.push_back(thing);
ThinkinOf = thing;
}
If I add a string parameter to constructor Guesser, all the errors will go away, another appears: expected constructor, destructor, or type conversion before '(' token.
I think the IDE misunderstands constructor of Guesser to constructor of Thing. Any idea?
I think the IDE misunderstands constructor of Guesser to constructor of Thing. Any idea?
Stop believing the compiler "misunderstands" code. When an error occurs, it is most likely because of something you have done. Not so likely the compiler is just arbitrarily interpreting your code incorrectly.
A Thing must be initialized with a string. You don't do so in the Guesser constructor.