6 Nov
2011
6 Nov
'11
9:17 p.m.
on Sun Nov 06 2011, Robert Jones
The shared_ptr docs suggest that a smart pointer employing a null deleter can be implemented using a functor. Why prefer a functor to a function?
Two reasons I can think of: - Function objects can have a templated operator(), so you don't need to write a new one for each T in shared_ptr<T>. - One less level of function call indirection (very minor win) -- Dave Abrahams BoostPro Computing http://www.boostpro.com