Allow passing QPointer<..> to CreateChild.
This commit is contained in:
parent
b0e408e53d
commit
ce3d2c5fb0
1 changed files with 4 additions and 2 deletions
|
|
@ -68,9 +68,11 @@ inline Value *CreateChild(
|
|||
parent,
|
||||
std::forward<Args>(args)...)->value();
|
||||
}
|
||||
} else {
|
||||
static_assert(requires(const Parent &t) { t.get(); });
|
||||
} else if constexpr (requires(const Parent & t) { t.get(); }) {
|
||||
return new Value(parent.get(), std::forward<Args>(args)...);
|
||||
} else {
|
||||
static_assert(requires(const Parent &t) { t.data(); });
|
||||
return new Value(parent.data(), std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue