Krishanu Debnath wrote:

Yes, as long as one of your () operator suitable match with your container's

element type.
Could for_each() work on several copies of functor?

What if some elements are not maintained by one copy of functor?

I didn't understand your above two questions.

Neah, sorry. I'm semiconscious today.

Now those questions after a mug of coffee:

Is it possible that for_each() works on several copies of functor, ex.

operator() is overloaded, and for_each() provides several types of data

to functor, so for_each() creates several copies of functor, and we

don't know which would be returned.

Someone's told me that it is not told that all elements will be

maintained by the same copy of functor.

And I'm not convinced about it, because how elements of list could be

more than one type when we have to declare the type of list.

Michal