Java unique_ptr test ownership enhancement to test
Make sure the object is owned before releasing ownership and passing ownership to unique_ptr instance.
This commit is contained in:
parent
1bf15210ef
commit
8bd9eb3f16
2 changed files with 19 additions and 0 deletions
|
|
@ -63,6 +63,10 @@ bool is_nullptr(Klass *p) {
|
|||
return p == nullptr;
|
||||
}
|
||||
|
||||
Klass *get_not_owned_ptr(Klass *p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
std::unique_ptr<Klass> makeKlassUniquePtr(const char* label) {
|
||||
return std::unique_ptr<Klass>(new Klass(label));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue