title: std::vector of std::shared_ptr usage
body: <p>The following code:</p>
  
  <pre><code>class Something
  {
  public:
       ~Something()
      {
      }
  };
  
  int main()
  {
      Something* s = new Something[1]; // raw pointer received from C api
      std::shared_ptr&lt;Something&gt; p = std::shared_ptr&lt;Something&gt;(s);
      std::vector&lt;std::shared_ptr&lt;Something&gt;&gt; v(&amp;p,&amp;p+1);
  
      return 0;
  }
  </code></pre>
  
  <p>gives the following error in VS Express 2010:</p>
  
  <pre><code>---------------------------
  Microsoft Visual C++ Debug Library
  ---------------------------
  Debug Assertion Failed!
  
  File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
  Line: 52
  
  Expression: _BLOCK_TYPE_IS_VALID(pHead-&gt;nBlockUse)
  
  For information on how your program can cause an assertion
  failure, see the Visual C++ documentation on asserts.
  </code></pre>
  
  <p>Remove the destructor from Something and the error disappears, Why do I get this error?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Later I will have something like:</p>
  
  <pre><code>Something* s = new Something[100];
  </code></pre>
  
  <p>and individual shared pointers will be passed around to other objects</p>