Added enter/leave to cpp gen