add shift-and-or in cpp