cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Functor vs. Function
Functor vs. Function
Feb 12, 2011 at 8:17pm UTC
PiMaster
(359)
What's the difference between a functor, which has the purpose of storing states in-between function calls, and a function with static variables?
Feb 12, 2011 at 10:04pm UTC
firedraco
(6246)
They are basically equivalent, except you can make several functors that each have their own state, whereas a function with statics will only be able to have 1 state.
Feb 13, 2011 at 4:04pm UTC
jsmith
(5804)
"functor" has a very specific meaning -- it is an object that (optionally) has a constru
CTOR
and implements the
FUNC
tion call operator.
Topic archived. No new replies allowed.