Lines Matching refs:CopyOnlyInt

61 class CopyOnlyInt {  class
63 CopyOnlyInt() { print_default_created(this); } in CopyOnlyInt() function in CopyOnlyInt
64 CopyOnlyInt(int v) : value{std::move(v)} { print_created(this, value); } in CopyOnlyInt() function in CopyOnlyInt
65 CopyOnlyInt(const CopyOnlyInt &c) { print_copy_created(this, c.value); value = c.value; } in CopyOnlyInt() function in CopyOnlyInt
66CopyOnlyInt &operator=(const CopyOnlyInt &c) { print_copy_assigned(this, c.value); value = c.value… in operator =()
67 ~CopyOnlyInt() { print_destroyed(this); } in ~CopyOnlyInt()
85 template <> struct type_caster<CopyOnlyInt> {
87 CopyOnlyInt value;
90 bool load(handle src, bool) { value = CopyOnlyInt(src.cast<int>()); return true; } in load()
91 …static handle cast(const CopyOnlyInt &m, return_value_policy r, handle p) { return pybind11::cast(… in cast()
92 static handle cast(const CopyOnlyInt *src, return_value_policy policy, handle parent) { in cast()
96 operator CopyOnlyInt*() { return &value; } in operator CopyOnlyInt*()
97 operator CopyOnlyInt&() { return value; } in operator CopyOnlyInt&()
118 r += py::cast<CopyOnlyInt>(o).value; /* copies */ in PYBIND11_NAMESPACE_END()
121 auto m3(py::cast<CopyOnlyInt>(o)); /* copies */ in PYBIND11_NAMESPACE_END()
130 m.def("copy_only", [](CopyOnlyInt m) { return m.value; }); in PYBIND11_NAMESPACE_END()
137 m.def("copy_tuple", [](std::tuple<CopyOnlyInt, CopyOnlyInt> t) { in PYBIND11_NAMESPACE_END() argument
140 …nested", [](std::pair<MoveOnlyInt, std::pair<std::tuple<MoveOrCopyInt, CopyOnlyInt, std::tuple<Mov… in PYBIND11_NAMESPACE_END() argument
151 auto &co = ConstructorStats::get<CopyOnlyInt>(); in PYBIND11_NAMESPACE_END()
168 m.def("copy_optional", [](std::optional<CopyOnlyInt> o) { in PYBIND11_NAMESPACE_END()
171 …f("move_optional_tuple", [](std::optional<std::tuple<MoveOrCopyInt, MoveOnlyInt, CopyOnlyInt>> x) { in PYBIND11_NAMESPACE_END()