8 Nov
2011
8 Nov
'11
8:14 p.m.
on Mon Nov 07 2011, "Peter Dimov"
Robert Jones wrote:
Thanks Gents - The phrasing of my question was hopelessly lax: I
appreciate in the general case why one might choose to use a functor rather than a function as a callable object, what I didn't grasp (and there may be nothing to grasp), was why this (from the shared_ptr docs)
struct null_deleter { void operator()(void const *) const { } };
Is implemented as a functor rather than a function.
There's nothing to grasp. The only difference is that sizeof( null_deleter ) is 1,
...or effectively zero if EBO is leveraged. -- Dave Abrahams BoostPro Computing http://www.boostpro.com