私は興味があります:
bool State::operator<(const State* S)
{
return this->operator<(*dynamic_cast<const State *>(S));
}
以下とまったく同じ:
bool State::operator<(const State* S)
{
return this->operator<(*(S));
}
参考までthis->operator<
に、呼び出されるのは次のとおりです。
bool State::operator<(const State& S)
{
return this->reward < S.reward ? true : false;
}
どちらがより「正しい」タイプで安全に使用できますか、実際の違いはありますか?