
24 Aug
2004
24 Aug
'04
1:25 p.m.
Vladimir Prus wrote:
extern void (*function)(); boost::shared_ptr<void ()> p2(function);
return 0; }
The first initialization, of course, work. The second produces a lots of errors. Do I miss something obvious?
Just to clarify: my original intention is to use shared_ptr to a function together with a custom deleter. I don't really think the above could compile. But when I add: struct null_deleter { template<class T> void operator()(T) const { } }; and change the code to be boost::shared_ptr<void ()> p2(function, null_deleter()) I still get errors. The complete example with the custom deleter is attached. - Volodya