diff options
author | Lenny Maiorani <lenny@colorado.edu> | 2020-11-21 17:23:17 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-22 10:54:33 +0100 |
commit | 840c3b501d179ec6d3f04b9c691a5f859d6783d9 (patch) | |
tree | 80eeb84a81f570d3bb25ec1445ebf6234b20e4fa /AK/NeverDestroyed.h | |
parent | bc5b8223b70990b906b1fa91cb6fd9e8e3c41663 (diff) | |
download | serenity-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.h | 2 |
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)...); } |