Function S2CellId.isValid

Returns true if id() represents a valid cell.

bool isValid() const;

All methods require isValid() to be true unless otherwise specified (although not all methods enforce this).