smart complement for cpp