summaryrefslogtreecommitdiff
path: root/AK/NeverDestroyed.h
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2020-11-21 17:23:17 -0700
committerAndreas Kling <kling@serenityos.org>2020-11-22 10:54:33 +0100
commit840c3b501d179ec6d3f04b9c691a5f859d6783d9 (patch)
tree80eeb84a81f570d3bb25ec1445ebf6234b20e4fa /AK/NeverDestroyed.h
parentbc5b8223b70990b906b1fa91cb6fd9e8e3c41663 (diff)
downloadserenity-840c3b501d179ec6d3f04b9c691a5f859d6783d9.zip
NeverDestroyed: Add tests
Problem: - It is difficult to refactor because there are no tests to bind the functionality. - Arguments are not forwarded correctly to the constructor. Solution: - Add tests. - Change constructor to take forwarding references.
Diffstat (limited to 'AK/NeverDestroyed.h')
-rw-r--r--AK/NeverDestroyed.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/NeverDestroyed.h b/AK/NeverDestroyed.h
index 64035a759a..ca4df2ee29 100644
--- a/AK/NeverDestroyed.h
+++ b/AK/NeverDestroyed.h
@@ -38,7 +38,7 @@ class NeverDestroyed {
public:
template<typename... Args>
- NeverDestroyed(Args... args)
+ NeverDestroyed(Args&&... args)
{
new (storage) T(forward<Args>(args)...);
}