From 723bc65b27292bb214f91725e9fc5b2ab2fc85e0 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 12 Nov 2015 23:27:20 +0100 Subject: [PATCH] fix for std::shared_ptr proposed by Vayu (fixes #8) --- include/pybind11/cast.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 5fe93426e..3832bc1ef 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -527,6 +527,12 @@ public: explicit operator type&() { return *(this->value); } explicit operator holder_type&() { return holder; } explicit operator holder_type*() { return &holder; } + + using type_caster::cast; + static PyObject *cast(const holder_type &src, return_value_policy policy, PyObject *parent) { + return type_caster::cast(src.get(), policy, parent); + } + protected: holder_type holder; };