By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

why do algorithms return a copy of the functor?

P: n/a
For example, for_each?

Sep 26 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

vsgdp wrote:
why do algorithms return a copy of the functor?
Most don't.
For example, for_each?
std::for_each is an exception. To quote the SGI STL documentation:

"This return value is sometimes useful, since a function object may
have local state. It might, for example, count the number of times that
it is called, or it might have a status flag to indicate whether or not
a call succeeded."

See http://www.sgi.com/tech/stl/for_each.html

Best regards,

Tom

Sep 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.