BRect rect1(0, 0, 100, 50); if (rect1.IsValid()) { // The rectangle is valid } BRect rect2(0, 0, -1, -1); if (!rect2.IsValid()) { // The rectangle is not valid }In the first example, a valid rectangle is created with an upper-left coordinate of (0,0) and a lower-right coordinate of (100,50). The IsValid function will return true. In the second example, an invalid rectangle is created with an upper-left coordinate of (0,0) and a lower-right coordinate of (-1,-1). The IsValid function will return false. The BRect class is part of the Be Operating System API.