Я использую его, когда в функции, которая принимает ссылку на объект того же типа, я хочу четко понять, к какому объекту я обращаюсь, где.
Например
class AABB
{
// ... members
bool intersects( AABB other )
{
return other.left() < this->right() &&
this->left() < other.right() &&
// +y increases going down
other.top() < this->bottom() &&
this->top() < other.bottom() ;
}
} ;
(vs)
class AABB
{
bool intersects( AABB other )
{
return other.left() < right() &&
left() < other.right() &&
// +y increases going down
other.top() < bottom() &&
top() < other.bottom() ;
}
} ;
С первого взгляда, на который указывает AABB right()
? this
добавляет немного осветлителя.