Skip to content

Commit 4b3bb06

Browse files
authored
Fix perfect forwarding in TypedAllocator::allocate. (#2008)
The original wasn't actually allowing universal references and if you have a datatype with a deleted copy constructor, the template substitution would fail here. This lets me use `TypedAllocator` for some type that isn't copyable. I doubt there would be any performance difference due to copy elision anyway.
1 parent 9457397 commit 4b3bb06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Analysis/include/Luau/TypedAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class TypedAllocator
4949

5050
T* block = stuff.back();
5151
T* res = block + currentBlockSize;
52-
new (res) T(std::forward<Args&&...>(args...));
52+
new (res) T(std::forward<Args>(args)...);
5353
++currentBlockSize;
5454
return res;
5555
}

0 commit comments

Comments
 (0)