title: Why it's possible to access std::unique_ptr<A>* u1 as u1[1000] and it still works
body: <p>Sorry for silly title, couldn't think how it should be.
  I'm playing with unique_ptr, created pointer to unique_ptr (I know I shouldn't create pointer to a unique_ptr, I'm just playing to see what happened)</p>
  
  <pre><code>class A
  {
    public:
      A() {std::cout&lt;&lt;"A const\n";}
      ~A() {std::cout&lt;&lt;"~A dest\n";}
      void fun()  {std::cout&lt;&lt;"A fun\n";}
  
  };
  
  int main()
  {
     std::unique_ptr&lt;A&gt;* u1 = new std::unique_ptr&lt;A&gt;(new A);
     u1[1000]-&gt;fun();
     delete u1;
     return 0;
  }
  </code></pre>
  
  <p>I expected output to be crash but it worked just as when I used  u1[0]. And I completely have no idea why, I completely expect it to crash. </p>
  
  <pre><code>A const
  A fun
  ~A dest
  </code></pre>
  
  <p>How come this code executes? 
  It works with g++ and also in the online c++ shell <a href="http://cpp.sh/" rel="nofollow noreferrer">http://cpp.sh/</a></p>