
Thanks for the quick response Steven, However I think if you look at it you'll see that the destructor hasn't been called yet when the crash happens. The error happens during the iteration in main when trying to print out the contents of the word class. The destructor for the CWordHash class won't be called until after that when main exits. On Tue, May 13, 2008 at 9:17 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
Julie Larson wrote:
Hello,
I'm using boost 1.35.0 and found this sample code about the hash set functionality:
http://www.boost.org/doc/libs/1_35_0/doc/html/intrusive/advanced_lookups_ins...
and modified it as shown below. I find that when iterating through the hash table, the thing crashes here (where the get_next function contains an invalid value for n):
<snip> ~CWordHash() { BOOST_FOREACH( CWord& w, m_hWords ) { CWord* pWord = &w; delete pWord;
I think this delete invalidates the iterator maintained by BOOST_FOREACH.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users