title: Using smart pointers for dynamically allocated arrays in C++
body: <p>Based on "Item 16: Use the same form in corresponding uses of <code>new</code> and <code>delete</code>" of Scott Meyers' Effective C++, you should not put dynamically allocated arrays in <code>auto_ptr</code> (or <code>tr1::shared_ptr</code>) since <code>delete p</code> instead of <code>delete[] p</code> is called upon destruction (also see <a href="https://stackoverflow.com/questions/6520844/using-auto-ptr-with-array">answers</a>). But does this still holds for C++11&lt; and more in particular for <code>std::shared_ptr</code> and <code>std::unique_ptr</code>, since I noticed in some open source code the use of <code>std::unique_ptr&lt;uint8_t[]&gt;</code>? And if the latter is correct, how could one distinguish between <code>new</code> and <code>new []</code> allocated data?</p>