Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-08-24 08:25:05


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




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