Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-08-24 08:03:46


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk