size_t is unsigned type, if columnCount == 1 your expression will be true. You can move -2 to left part like _columnNumber + 2 <= columnCount