mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:17:44 +00:00
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.
This commit is contained in:
parent
bc5b8223b7
commit
840c3b501d
2 changed files with 96 additions and 1 deletions
|
@ -38,7 +38,7 @@ class NeverDestroyed {
|
|||
|
||||
public:
|
||||
template<typename... Args>
|
||||
NeverDestroyed(Args... args)
|
||||
NeverDestroyed(Args&&... args)
|
||||
{
|
||||
new (storage) T(forward<Args>(args)...);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue