このコードに問題がありますが、原因がわかりません。
bool Parser::validateName(std::string name) {
int pos = name.find(INVALID_CHARS); //pos is -1,
bool result = ((name.find(INVALID_CHARS)) < 0); //result is false
//That was weird, does that imply that -1 >= 0?, let's see
result = (pos < 0) //result is true
result = ((name.find(INVALID_CHARS)) == -1) //result is true
result = (-1 < 0) //result is true
...
}
2行目の結果がfalseであるのはなぜですか。見えないものはありますか?