working decorator in cpp