Suppose I want to create a functor that acts upon some general type.
For example

```
template<typename Ape>
class functor1
{
   void operator()(Ape& m)
   {
      // Do something to m
   }
};

```

This has been the standard way of doing things for me. However, I also have another way:

```
class functor2
{
   template<typename Ape>
   void operator()(Ape& m)
   {
      // Do something to m
   }
};

```

The advantage of the second approach is that I don't have to explicitly state the type of the template.

```
int main()
{
   std::vector<chimpanzee> chimps(100);
   for_each(chimps.begin(), chimps.end(), functor1<chimpanzee>()); // Explicity state the type
   for_each(chimps.begin(), chimps.end(), functor2()); // Less typing. Will it work?
}

```

Will the second version work? Or am I missing something? If it works are there any advantages to the first approach?