mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Use std::make_unique
This commit is contained in:
parent
faaee810e6
commit
fac7198728
1 changed files with 2 additions and 1 deletions
|
|
@ -10,10 +10,11 @@
|
|||
#include <utility>
|
||||
|
||||
//! Substitute for C++14 std::make_unique.
|
||||
//! DEPRECATED use std::make_unique in new code.
|
||||
template <typename T, typename... Args>
|
||||
std::unique_ptr<T> MakeUnique(Args&&... args)
|
||||
{
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
return std::make_unique<T>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue