We\'re not allowed to define a functor struct inside a function because one is not allowed to use function declared structs in the instantiation of function templates.
Local structs / classes can't have static data members, only static member functions. Also, they can't be templates.