
2 May
2006
2 May
'06
5:01 p.m.
David Abrahams wrote:
"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
"Neal Becker" <ndbecker2@gmail.com> wrote
I'd like to use boost::function to wrap (pointer to) function to pass to template functions that expect function objects. I'm just wondering, though, if using boost::function wrapper will introduce additional overhead into the function call?
boost::function will introduce an extra virtual function call (which is not a big deal in most cases).
Actually it's not a virtual call, it's a call through a function pointer. That's one less indirection.
Do you think a smart compiler might optimize this to a direct call?