ThirdParty/SmallVector: Compile fixes

This commit is contained in:
Stenzek 2024-11-29 17:05:16 +10:00
parent b39f1558ec
commit 83274c7e3b
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -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)...);