Fix scope of functor with member template