From bf8bb83ec5c12c143642a4c10cdbadda8a688469 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 2 Dec 2002 12:40:18 +0000 Subject: [PATCH] initial commit [SVN r16473] --- .../python/converter/shared_ptr_deleter.hpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/boost/python/converter/shared_ptr_deleter.hpp diff --git a/include/boost/python/converter/shared_ptr_deleter.hpp b/include/boost/python/converter/shared_ptr_deleter.hpp new file mode 100644 index 00000000..eb02e18a --- /dev/null +++ b/include/boost/python/converter/shared_ptr_deleter.hpp @@ -0,0 +1,23 @@ +// Copyright David Abrahams 2002. Permission to copy, use, +// modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided +// "as is" without express or implied warranty, and with no claim as +// to its suitability for any purpose. +#ifndef SHARED_PTR_DELETER_DWA2002121_HPP +# define SHARED_PTR_DELETER_DWA2002121_HPP + +namespace boost { namespace python { namespace converter { + +struct shared_ptr_deleter +{ + shared_ptr_deleter(handle<> owner) + : owner(owner) {} + + void operator()(void const*) { owner.reset(); } + + handle<> owner; +}; + +}}} // namespace boost::python::converter + +#endif // SHARED_PTR_DELETER_DWA2002121_HPP