Add functor cmp and correct trigger in cpp.snip