| 55 | }; |
| 56 | |
| 57 | class UnusualOpRef { |
| 58 | public: |
| 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 | |
| 64 | private: |
| 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). |
no outgoing calls