unique_ptr<T> should be unique_ptr<T[]> when used with array

This commit is contained in:
Dennis Luxen 2014-10-02 19:26:57 +02:00
parent 9cc5ca5c58
commit 28302a5040

View File

@ -44,7 +44,7 @@ template <class T, class... Types> std::unique_ptr<T> make_unique(Types &&... Ar
} }
// make_unique<T[]> // make_unique<T[]>
template <class T> std::unique_ptr<T> make_unique(std::size_t Size) template <class T> std::unique_ptr<T[]> make_unique(std::size_t Size)
{ {
return (std::unique_ptr<T>(new T[Size]())); return (std::unique_ptr<T>(new T[Size]()));
} }