From c725ffd1060ce9ea625cdba815b38610efbdf441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Krupi=C5=84ski?= Date: Wed, 29 Sep 2021 14:37:30 +0200 Subject: [PATCH] Use forwarding references with std::forward() --- include/vk_mem_alloc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 59af0e2..ae45721 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -3616,7 +3616,7 @@ class VmaPoolAllocator public: VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity); ~VmaPoolAllocator(); - template T* Alloc(Types... args); + template T* Alloc(Types&&... args); void Free(T* ptr); private: @@ -3658,7 +3658,7 @@ VmaPoolAllocator::~VmaPoolAllocator() } template -template T* VmaPoolAllocator::Alloc(Types... args) +template T* VmaPoolAllocator::Alloc(Types&&... args) { for(size_t i = m_ItemBlocks.size(); i--; ) { @@ -6272,7 +6272,7 @@ class VmaAllocationObjectAllocator public: VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks); - template VmaAllocation Allocate(Types... args); + template VmaAllocation Allocate(Types&&... args); void Free(VmaAllocation hAlloc); private: @@ -14160,7 +14160,7 @@ VmaAllocationObjectAllocator::VmaAllocationObjectAllocator(const VkAllocationCal { } -template VmaAllocation VmaAllocationObjectAllocator::Allocate(Types... args) +template VmaAllocation VmaAllocationObjectAllocator::Allocate(Types&&... args) { VmaMutexLock mutexLock(m_Mutex); return m_Allocator.Alloc(std::forward(args)...);