Skip to content

issue with unique_ptr ? #608

@jkhoogland

Description

@jkhoogland

Hi,

I came across the following issue today which seems like a bug.

I have a class Foo that produces Bar and returns a unique_ptr to an instance of Bar.

On running a C++11 executable it works fine (little main in the code attached).
On running python, it craps out with

RuntimeError: return_value_policy = move, but the object is neither movable nor copyable!

Am I missing something ? The class Bar is moveable, and copyable...

Code attached to reproduce.

pybind11_issue_unique_ptr.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions