I have a function that is taking two pointers as parameters.

```
bool function(T* a, T* b);

```

And a container (vector).

```
vector<T> vector;

```

I wish to use an algorithm of the STL (the for\_each) to apply the function on the elements of the vector. However, I don't know if the pointers of the elements will go automatically in the function as parameters. For example, will

```
for_each(vector.begin(), vector.end(), function(/*something here?*/))

```

work, or I need to go with a loop (the new for each in loop of the C++11) ?