Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2000-08-30 12:13:18


> > Defaulted template parameter class Desallocator=boost::Delete ?
>
> Something like that. I want to be able to accept either
> a function or a functor with no space overhead by default.
>
"Generative Programming" had a discussion using the strategy pattern that
may fit problem here. I don't have my copy here at work, but if you want the
code, you can email me directly and I'll bring it in.

If memory serves me correctly it would go something like this.

class NoOp {};

class VirtualDelete {
public: virtual ~VirtualDelete() {}
};

template<class T, class DeleteType = NoOp>
class shared_ptr : public DeleteType {
....
};

  -Gary-

gary.powell_at_[hidden]


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