Lines Matching refs:MoveOrCopyInt

49 class MoveOrCopyInt {
51 MoveOrCopyInt() { print_default_created(this); }
52 MoveOrCopyInt(int v) : value{std::move(v)} { print_created(this, value); }
53 MoveOrCopyInt(MoveOrCopyInt &&m) { print_move_created(this, m.value); std::swap(value, m.value); }
54 MoveOrCopyInt &operator=(MoveOrCopyInt &&m) { print_move_assigned(this, m.value); std::swap(value, m.value); return *this; }
55 MoveOrCopyInt(const MoveOrCopyInt &c) { print_copy_created(this, c.value); value = c.value; }
56 MoveOrCopyInt &operator=(const MoveOrCopyInt &c) { print_copy_assigned(this, c.value); value = c.value; return *this; }
57 ~MoveOrCopyInt() { print_destroyed(this); }
79 template <> struct type_caster<MoveOrCopyInt> {
80 PYBIND11_TYPE_CASTER(MoveOrCopyInt, _("MoveOrCopyInt"));
81 bool load(handle src, bool) { value = MoveOrCopyInt(src.cast<int>()); return true; }
82 static handle cast(const MoveOrCopyInt &m, return_value_policy r, handle p) { return pybind11::cast(m.value, r, p); }
116 r += py::cast<MoveOrCopyInt>(o).value; /* moves */
119 MoveOrCopyInt m1(py::cast<MoveOrCopyInt>(o)); /* moves */
129 m.def("move_or_copy", [](MoveOrCopyInt 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) {
147 auto &mc = ConstructorStats::get<MoveOrCopyInt>();
154 d["MoveOrCopyInt"] = py::cast(mc, py::return_value_policy::reference);
165 m.def("move_or_copy_optional", [](std::optional<MoveOrCopyInt> o) {
171 m.def("move_optional_tuple", [](std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>> x) {