Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2000-12-04 23:53:18


> TODO list, which is basically just a B&N base class to provide pool
> allocation for its derived class. Then, a user class wanting
> automatic pool
> allocation can just derive from that base class.

I actually wrote the template...You instantiate it like this:

class waycool : public Type_Specific_Pool_Base<waycool> {...};

The essence of the template is:

template<class T>
class Type_Specific_Pool_Base {
public:
  Type_Specific_Pool_Base();
  virtual ~Type_Specific_Pool_Base();
  void* operator new(size_t size);
  void* operator new(size_t size, T* rhs) ;
  void operator delete(void* target, size_t size);
}

I didn't post it b/c it crashes when I use it with std::stack (the only
collection I tried) and I haven't had a chance to track it down. Works fine
for normal new/delete. Anyway, if you want it, let me know.

Jeff


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