take func as const&