
24 Aug
2004
24 Aug
'04
1:03 p.m.
I wonder if shared_ptr can hold a pointer to a function. I've just tried the following program: #include <boost/shared_ptr.hpp> using namespace boost; int main() { extern int* object; boost::shared_ptr<int> p(object); 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? TIA, Volodya