From 6cf6dc9c76bbacbecdb808c451ede9031668b34c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 3 Apr 2012 14:50:06 -0700 Subject: pmt: added advanded pmt_set_deleter (c++ only) --- gruel/src/lib/pmt/pmt_int.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gruel/src/lib/pmt/pmt_int.h') diff --git a/gruel/src/lib/pmt/pmt_int.h b/gruel/src/lib/pmt/pmt_int.h index 3a5cd382b..745dbc666 100644 --- a/gruel/src/lib/pmt/pmt_int.h +++ b/gruel/src/lib/pmt/pmt_int.h @@ -38,8 +38,15 @@ namespace pmt { class GRUEL_API pmt_base : boost::noncopyable { mutable boost::detail::atomic_count count_; +public: + static void default_deleter(pmt_base *p){ + delete p; + } + + boost::function deleter_; + protected: - pmt_base() : count_(0) {}; + pmt_base() : count_(0), deleter_(&pmt::pmt_base::default_deleter) {}; virtual ~pmt_base(); public: -- cgit