MCPcopy Create free account
hub / github.com/pybind/pybind11 / UnusualOpRef

Class UnusualOpRef

tests/pybind11_tests.h:57–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57class UnusualOpRef {
58public:
59 using NonTrivialType = std::shared_ptr<int>; // Almost any non-trivial type will do.
60 // Overriding operator& should not break pybind11.
61 NonTrivialType operator&() { return non_trivial_member; }
62 NonTrivialType operator&() const { return non_trivial_member; }
63
64private:
65 NonTrivialType non_trivial_member;
66};
67
68/// Custom cast-only type that casts to a string "rvalue" or "lvalue" depending on the cast
69/// context. Used to test recursive casters (e.g. std::tuple, stl containers).

Callers 1

TEST_SUBMODULEFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_SUBMODULEFunction · 0.68