unique_ptr to char* conversion
<p>I used to allocate memory in my C++ project with new</p>

<pre><code>char* buffer = new char [size];
...
delete[] buffer;
</code></pre>

<p>and I'd really like to move forward and use <code>unique_ptr</code>, like this</p>

<pre><code>unique_ptr&lt;char[]&gt;buffer(new char[size]);
</code></pre>

<p>but then I use <code>istream&amp; get (char* s, streamsize n);</code> which takes <code>char*</code> as a first argument, so what should I do? I've tried to cast types, but failed. I also know I can use <code>vector&lt;char&gt;</code> instead of pointers, but I don't really like to use it. Thank you!</p>