Skip to content

Expose shared_ptr to const #440

@MasterBe

Description

@MasterBe

Hello,

I am trying to expose std::shared_ptr<const Foo> and especially in my case I need std::vector<std::shared_ptr<const Foo>>. I tried:

  1. boost::python::implicitly_convertible<std::shared_ptr<Foo>,std::shared_ptr<const Foo>>();
  2. boost::python::register_ptr_to_python<std::shared_ptr<const Foo>>();

Both 1 and 2 don't work in jupyter notebook getting error: TypeError: No to_python (by-value) converter found for C++ type. Could you please advise on how to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions