Lines Matching refs:MoveOnlyInt

37 class MoveOnlyInt {
39 MoveOnlyInt() { print_default_created(this); }
40 MoveOnlyInt(int v) : value{std::move(v)} { print_created(this, value); }
41 MoveOnlyInt(MoveOnlyInt &&m) { print_move_created(this, m.value); std::swap(value, m.value); }
42 MoveOnlyInt &operator=(MoveOnlyInt &&m) { print_move_assigned(this, m.value); std::swap(value, m.value); return *this; }
43 MoveOnlyInt(const MoveOnlyInt &) = delete;
44 MoveOnlyInt &operator=(const MoveOnlyInt &) = delete;
45 ~MoveOnlyInt() { print_destroyed(this); }
73 template <> struct type_caster<MoveOnlyInt> {
74 PYBIND11_TYPE_CASTER(MoveOnlyInt, _("MoveOnlyInt"));
75 bool load(handle src, bool) { value = MoveOnlyInt(src.cast<int>()); return true; }
76 static handle cast(const MoveOnlyInt &m, return_value_policy r, handle p) { return pybind11::cast(m.value, r, p); }
117 r += py::cast<MoveOnlyInt>(o).value; /* moves */
120 MoveOnlyInt m2(py::cast<MoveOnlyInt>(o)); /* moves */
128 m.def("move_only", [](MoveOnlyInt m) { return m.value; });
131 m.def("move_pair", [](std::pair<MoveOnlyInt, MoveOrCopyInt> p) {
134 m.def("move_tuple", [](std::tuple<MoveOnlyInt, MoveOrCopyInt, MoveOnlyInt> t) {
140 m.def("move_copy_nested", [](std::pair<MoveOnlyInt, std::pair<std::tuple<MoveOrCopyInt, CopyOnlyInt, std::tuple<MoveOnlyInt>>, MoveOrCopyInt>> x) {
149 auto &mo = ConstructorStats::get<MoveOnlyInt>();
155 d["MoveOnlyInt"] = py::cast(mo, py::return_value_policy::reference);
162 m.def("move_optional", [](std::optional<MoveOnlyInt> o) {
171 m.def("move_optional_tuple", [](std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>> x) {