xo-alloc2: Use move semantics for std_copy_for
Prep for moving to ACollector interface
This commit is contained in:
parent
b88d181906
commit
353de0725a
1 changed files with 5 additions and 5 deletions
|
|
@ -42,14 +42,14 @@ namespace xo {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T * std_copy_for(const T * src) noexcept {
|
T * std_copy_for(T * src) noexcept {
|
||||||
T * copy = (T *)(this->alloc_copy_for(src));
|
void * mem = this->alloc_copy_for(src);
|
||||||
|
|
||||||
if (copy) {
|
if (mem) {
|
||||||
*copy = *src;
|
return new (mem) T(std::move(*src));
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue