S
Steven T. Hatton
In this example:
void print(int i) { std::cout<<i<<" "; }
for_each(coll.begin(), coll.end(), print);
What kind of entity is "print" when it appears as an actual parameter in the
for_each function call? It's not an object. Should it be thought of as a
reference to the addressable location which would be pointed to by a
function pointer? Is it an "alias" for a function pointer?
void print(int i) { std::cout<<i<<" "; }
for_each(coll.begin(), coll.end(), print);
What kind of entity is "print" when it appears as an actual parameter in the
for_each function call? It's not an object. Should it be thought of as a
reference to the addressable location which would be pointed to by a
function pointer? Is it an "alias" for a function pointer?