genfun.cc: add gen_fun::summate method