The following is a common (and soon to be *very* common) expression: if (match(token_type)) consume(); Using consume_if() makes this a bit simpler and makes it less likely to forget to invoke consume() after the match().