c++11 - boost::multi_index_container erase function rehases? -


I have the following problem: I have a promotion: :: mult_index_container, here is a simplified definition of the TYPE an integral type

  boost :: multi_index:  a member function indicator  and type: m_id  by  m_id : multi_index_container & lt; TYPE *, Promotion: Multi_Index :: Index_Bine & lt; :: multi_index :: hashed_unique promote & lt; Boost :: multi_index :: tag & lt; By_hashed_id & gt;, boost :: mult_index :: member & lt; Type, const type, and type :: m_id & gt; & Gt; & Gt; & Gt; Map;  

When I delete an object in the following way:

  hashmap = map.index.get & quot; By_hashed_id & gt; () This = hishmap.fid (30); Erase it; /// Remove the underlying pointer hashmap.rase (this); Erase the /// map (the map is shown again (segfault) ()?  

are trying to touch it again the code seems to crash whenever Map , what no one knows is that this is normal behavior, it can be reborn a delete function before removing indicators, which will result in a Segfolt results because the indicator has already been deleted (Definitely it is decided that delete erase which is anyway more suitable!)

I found the following trace after the segmentation fault.

last stack trace output:

  [a9203: 03910] signal: segmentation fault (11) 121 [a9203: 03910] Signal code: address not mapped (1 ) 122 [a9203: 03910] addresses denied on: (null) 123 [a9203: 03910] [0] /lib64/libc.so.6 () [0x36846329a0] 124 [a9203: 03,910] [1] / lib64 / libc. so.6 () [0x368468e312] 125 [a9203: 03,910] [2] / program (ZNSt10_HashtableIjSt4pairIKjN15BodyProcessInfo5FlagsEESaIS4_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS6_18_Mod _range_h AshingENS6_20_Default_ranged_hashENS6_20_Prime_rehash_policyENS6_17_Hashtable_traitsILb0ELb0ELb1EEEE5clearEv + 0x3F)  

itemprop = "text">

To answer the question in your subject line: Directed Index , As you use in the code shown, it is not like H / Rehash ever because they are not based on the hedged index (which appears to be you are not used here) delete But do not start over again. The symbol shown on stack traces looks completely foreign for Boost. Multi Indexes


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -