Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Using shared_ptr in vector causes error

boost-bugs
2010-12-08
2013-05-14
  • Ian Simpson
    Ian Simpson
    2010-12-08

    I have a vector declared like so.

    vector< shared_ptr<delim_list> > row_data;
    

    delim_list is a custom class that encapsulates a vector of std::strings.

    The vector gets filled like so.

    shared_ptr<delim_list> insert_list(new delim_list(line, ','));
    row_data.push_back(insert_list);
    

    When the vector row_data goes out of scope, I get a memory access reading violation thrown from the std::string class. I don't really know whats going on. Any help is appreciated.