Usando o Boost Python & std :: shared_ptr

Eu estou tentando fazer o Boost Python jogar bem com o std :: shared_ptr. Atualmente, estou recebendo este erro:

Traceback (most recent call last):
  File "test.py", line 13, in <module>
    comp.place_annotation(circle.centre())
TypeError: No to_python (by-value) converter found for C++ type: std::shared_ptr<cgl::Anchor>

Da chamada circle.centre (), que retorna um std :: shared_ptr. Eu poderia mudar todos os std :: shared_ptr para um boost :: shared_ptr (com o qual o Boost Python funciona bem) no entanto a quantidade de código para alterar consideravelmente e eu gostaria de usar a biblioteca padrão.

O método do círculo é declarado assim:

const std::shared_ptr<Anchor> centre() const
{
    return Centre;
}

A classe âncora assim:

class Anchor
{
    Point Where;
    Annotation* Parent;
public:

    Anchor(Annotation* parent) :
        Parent(parent)
    {
        // Do nothing.
    }

    void update(const Renderer& renderer)
    {
        if(Parent)
        {
            Parent->update(renderer);
        }
    }

    void set(Point point)
    {
        Where = point;
    }

    Point where() const
    {
        return Where;
    }
};

E o código relevante do Boost Python é:

class_<Circle, bases<Annotation> >("Circle", init<float>())
.def("radius", &Circle::radius)
    .def("set_radius",  &Circle::set_radius)
    .def("diameter", &Circle::diameter)
    .def("top_left", &Circle::top_left)
    .def("centre", &Circle::centre);

// The anchor base class.
class_<Anchor, boost::noncopyable>("Anchor", no_init)
    .def("where", &Anchor::where);

Estou usando o Boost 1.48.0. Alguma ideia?

questionAnswers(4)

yourAnswerToTheQuestion