mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-13 06:47:30 +00:00
ThirdParty/SmallVector: Compile fixes
This commit is contained in:
parent
b39f1558ec
commit
83274c7e3b
4
src/common/thirdparty/SmallVector.h
vendored
4
src/common/thirdparty/SmallVector.h
vendored
@ -183,7 +183,7 @@ protected:
|
|||||||
/// NewSize.
|
/// NewSize.
|
||||||
bool isSafeToReferenceAfterResize(const void *Elt, size_t NewSize) {
|
bool isSafeToReferenceAfterResize(const void *Elt, size_t NewSize) {
|
||||||
// Past the end.
|
// Past the end.
|
||||||
if (LLVM_LIKELY(!isReferenceToStorage(Elt)))
|
if (!isReferenceToStorage(Elt)) [[likely]]
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Return false if Elt will be destroyed by shrinking.
|
// Return false if Elt will be destroyed by shrinking.
|
||||||
@ -946,7 +946,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename... ArgTypes> reference emplace_back(ArgTypes &&... Args) {
|
template <typename... ArgTypes> reference emplace_back(ArgTypes &&... Args) {
|
||||||
if (LLVM_UNLIKELY(this->size() >= this->capacity()))
|
if (this->size() >= this->capacity()) [[unlikely]]
|
||||||
return this->growAndEmplaceBack(std::forward<ArgTypes>(Args)...);
|
return this->growAndEmplaceBack(std::forward<ArgTypes>(Args)...);
|
||||||
|
|
||||||
::new ((void *)this->end()) T(std::forward<ArgTypes>(Args)...);
|
::new ((void *)this->end()) T(std::forward<ArgTypes>(Args)...);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user