C++ std::vector<std::shared_ptr>
<p>I have a problem with the vector of shared_ptrS. My code is :</p>

<pre><code>//--------scoala.h--------

class Scoala
{
public:
    Scoala(std::string );

    int adaugaElev(std::shared_ptr&lt;Elev&gt; elev);
private:

    std::vector&lt;std::shared_ptr &lt;Elev&gt;&gt; __elevi;
};



//-----------scoala.cpp-----------------------------

int Scoala::adaugaElev(std::shared_ptr&lt;Elev&gt; elev)
{
    __elevi.push_back(elev);
    return __elevi.size() - 1;
}
</code></pre>

<p>I run it  and I got this  "Unhandled exception at 0x0137b559 in elev.exe: 0xC0000005: Access violation reading location 0xcccccd0c". What's wrong ?</p>
