diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-07-01 09:53:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-07-01 16:19:00 +0200 |
commit | f0db6d8ccdf77dab462ea299b497bbfdabcff515 (patch) | |
tree | f392cde30d4ee51c920c5be8608a3aaf45cbd05f /sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp | |
parent | 6d81913ed1189a5c7b1e26d2456f05e8e8684914 (diff) |
Fix compilation of unique pointer converters for derived classes
Add a std::move() to the converter.
Also add a test, which currently still fails. The pointer
needs to be moved back after the call.
Task-number: PYSIDE-454
Change-Id: I173d1becdbac53739923ddbce8a8cdc4f203ccea
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp')
-rw-r--r-- | sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp b/sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp index e1056412c..df4b566fa 100644 --- a/sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp +++ b/sources/shiboken6/tests/libsmart/stduniqueptrtestbench.cpp @@ -17,6 +17,17 @@ std::ostream &operator<<(std::ostream &str, const std::unique_ptr<Integer> &p) return str; } +std::ostream &operator<<(std::ostream &str, const std::unique_ptr<Smart::Integer2> &p) +{ + str << "unique_ptr<Integer>("; + if (p.get()) + str << p->value(); + else + str << "nullptr"; + str << ')'; + return str; +} + std::ostream &operator<<(std::ostream &str, const std::unique_ptr<int> &p) { str << "unique_ptr<int>("; @@ -115,3 +126,8 @@ int StdUniquePtrVirtualMethodTester::doModifyIntegerByValue(std::unique_ptr<Inte { return p->value() + 1; } + +void StdUniquePtrTestBench::printInteger2(const std::unique_ptr<Smart::Integer2> &p) +{ + std::cerr << __FUNCTION__ << ' ' << p << '\n'; +} |