Use forwarding for make_unique arguments
This commit is contained in:
parent
601c40a63b
commit
f499779ffc
@ -142,11 +142,10 @@ template <typename T, size_t N>
|
|||||||
size_t elems(T (&)[N])
|
size_t elems(T (&)[N])
|
||||||
{ return N; }
|
{ return N; }
|
||||||
|
|
||||||
|
template<class T, class...Args>
|
||||||
template <typename T, typename ...Args>
|
std::unique_ptr<T> make_unique(Args&&... args) {
|
||||||
std::unique_ptr<T>
|
return std::unique_ptr<T> (new T(std::forward<Args>(args)...));
|
||||||
make_unique (const Args &...args)
|
}
|
||||||
{ return std::unique_ptr<T> (new T (args...)); }
|
|
||||||
|
|
||||||
|
|
||||||
struct fourcc {
|
struct fourcc {
|
||||||
|
Loading…
Reference in New Issue
Block a user