optional cpp generation