title: C++ array of char using unique_ptr
body: <p>First of all, I know this is not the best way to do this, I'm just looking how it should be done. I created a class called bord,which holds a member</p>
  
  <pre><code>        std::unique_ptr&lt;std::unique_ptr&lt;char&gt;[] &gt; char_bord;
  </code></pre>
  
  <p>Which should be the correct syntax, then I try to initialize this in the constructor:</p>
  
  <pre><code>bord::bord():char_bord(new std::unique_ptr&lt;char&gt;[10])
  {
      //char_bord=new std::unique_ptr&lt;char&gt;[10]; //This did not seem to work aswell.
      for(int i=0;i&lt;10;i++)
        char_bord[i]=new std::unique_ptr&lt;char&gt;[](new char[10]); 
      return;
  }
  </code></pre>
  
  <p>This results in the following heap of errors, which I did not manage to decipher.</p>
  
  <pre><code>jelmer@jelmer-N56JN:~/Git/Board/lib$ g++ -std=c++0x bord.c
  In file included from bord.c:1:0:
  bord.h:20:1: error: new types may not be defined in a return type
   class bord
   ^
  bord.h:20:1: note: (perhaps a semicolon is missing after the definition of ‘bord’)
  bord.c:3:12: error: return type specification for constructor invalid
   bord::bord():char_bord(new std::unique_ptr&lt;char&gt;[10])
              ^
  bord.c: In constructor ‘bord::bord()’:
  bord.c:7:46: error: expected primary-expression before ‘]’ token
         char_bord[i]=new std::unique_ptr&lt;char&gt;[](new char[10]); 
                                                ^
  bord.c:7:60: error: parenthesized initializer in array new [-fpermissive]
         char_bord[i]=new std::unique_ptr&lt;char&gt;[](new char[10]); 
                                                              ^
  bord.c:7:19: error: no match for ‘operator=’ (operand types are ‘std::unique_ptr&lt;char&gt;’ and ‘std::unique_ptr&lt;char&gt;*’)
         char_bord[i]=new std::unique_ptr&lt;char&gt;[](new char[10]); 
                     ^
  bord.c:7:19: note: candidates are:
  In file included from /usr/include/c++/4.9/memory:81:0,
                   from bord.h:19,
                   from bord.c:1:
  /usr/include/c++/4.9/bits/unique_ptr.h:249:7: note: std::unique_ptr&lt;_Tp, _Dp&gt;&amp; std::unique_ptr&lt;_Tp, _Dp&gt;::operator=(std::unique_ptr&lt;_Tp, _Dp&gt;&amp;&amp;) [with _Tp = char; _Dp = std::default_delete&lt;char&gt;]
         operator=(unique_ptr&amp;&amp; __u) noexcept
         ^
  /usr/include/c++/4.9/bits/unique_ptr.h:249:7: note:   no known conversion for argument 1 from ‘std::unique_ptr&lt;char&gt;*’ to ‘std::unique_ptr&lt;char&gt;&amp;&amp;’
  /usr/include/c++/4.9/bits/unique_ptr.h:269:2: note: template&lt;class _Up, class _Ep&gt; typename std::enable_if&lt;std::__and_&lt;std::is_convertible&lt;typename std::unique_ptr&lt;_Up, _Ep&gt;::pointer, typename std::unique_ptr&lt;_Tp, _Dp&gt;::_Pointer::type&gt;, std::__not_&lt;std::is_array&lt;_Up&gt; &gt; &gt;::value, std::unique_ptr&lt;_Tp, _Dp&gt;&amp;&gt;::type std::unique_ptr&lt;_Tp, _Dp&gt;::operator=(std::unique_ptr&lt;_Up, _Ep&gt;&amp;&amp;) [with _Up = _Up; _Ep = _Ep; _Tp = char; _Dp = std::default_delete&lt;char&gt;]
    operator=(unique_ptr&lt;_Up, _Ep&gt;&amp;&amp; __u) noexcept
    ^
  /usr/include/c++/4.9/bits/unique_ptr.h:269:2: note:   template argument deduction/substitution failed:
  bord.c:7:19: note:   mismatched types ‘std::unique_ptr&lt;_Tp, _Dp&gt;’ and ‘std::unique_ptr&lt;char&gt;*’
         char_bord[i]=new std::unique_ptr&lt;char&gt;[](new char[10]); 
                     ^
  In file included from /usr/include/c++/4.9/memory:81:0,
                   from bord.h:19,
                   from bord.c:1:
  /usr/include/c++/4.9/bits/unique_ptr.h:278:7: note: std::unique_ptr&lt;_Tp, _Dp&gt;&amp; std::unique_ptr&lt;_Tp, _Dp&gt;::operator=(std::nullptr_t) [with _Tp = char; _Dp = std::default_delete&lt;char&gt;; std::nullptr_t = std::nullptr_t]
         operator=(nullptr_t) noexcept
         ^
  /usr/include/c++/4.9/bits/unique_ptr.h:278:7: note:   no known conversion for argument 1 from ‘std::unique_ptr&lt;char&gt;*’ to ‘std::nullptr_t’
  </code></pre>
  
  <p>What am I doing wrong, assuming I am doing something wrong.</p>