Boost logo

Boost Users :

Subject: [Boost-users] [BGL] seg fault : more readable
From: John Robertson (jrobertson7711_at_[hidden])
Date: 2009-10-22 18:41:53


The following compiles and runs.

typedef string Colour;

struct edge_properties
{
 
  vector < set< Colour > > eColours;

}

//get a reference to the vector of the sets of colours of some edge.
vector < set<Colour> > & v_colour_outset =  get(m_eColours_map,*out_iter);    // Here *out_iter is some edge.                               
                                              
//Add a set<Colour> to  v_colour_outset ie. to get(m_eColours_map,*out_iter) .
set<Colour> colour_set;
v_colour_outset.push_back(colour_set);
                                       
// get a reference to one of the set<colour> in get(m_eColours_map,*out_iter) .                 

set<Colour> & outcset = v_colour_outset[1];    //or [0], or any elt..

But when I try to add a new colour to this set
 
outcset.insert("Blue");

I get segfault.
My guess is that there is a predetermined size for colour_set, and when it is push_backed into v_colour_outset, a new colour cannot be added into it.

Thanks
- JR

 (SHIFT_JIS)Japanese (EUC-JP)Japanese (ISO-2022-JP)Korean (ISO-2022-KR)Korean (EUC-KR)Thai (TIS-620-2533)Thai (WINDOWS-874)Vietnamese (TCVN-5712)Vietnamese (VISCII)Vietnamese (WINDOWS-1258)Unicode (UTF-7)Unicode (UTF-8)Unicode (UTF-16)Unicode (UTF-32)| Full Headers Mail Search #yui-main { background-color:#D6DEEC }gLaunchProfile.stop('RT_RP', false);gLaunchProfile.start('RT_BP');gLaunchProfile.start('LD_JS_BP');YAHOO.mc.intl = "us";YAHOO.mc.IM_TOGGLE_STRINGS = {"im_settings_helpurl" : "http://help.yahoo.com/l/us/yahoo/mail/classic/chat/","im_settings_help_toggle" : "1","im_enable_mobile_l10n": "1","im_sign_in": "true","im_time_format_am" : "AM","im_time_format_pm" : "PM","im_date_time_format" : "{M}/{d}/{yy} {h}:{mm} {A}"};if (YAHOO.mc.page..generic) {YAHOO.mc.page.generic.initComposeMenu();}YAHOO.mc.page.BasieSpaceId= "398300973";YAHOO.mc.page.TriggerULT=true;YAHOO.util.Event.onDOMReady(function () {sessionMgr.initSession();sessionMgr.loadFromBookmarks();});var adPrefetch = true;var isAdPrefetched = false;if (document.getElementById("JSMailOptionsLink")) {document.getElementById("JSMailOptionsLink").href = optionObj["JSMailOptionsLink"];}if (document.getElementById("chk_pop_options") ||
 document.getElementById("chk_pop_error") || document.getElementById("option_bad_folder") || document.getElementById("folders_options_spam") || document.getElementById("folders_options_sent") || document.getElementById("spam_edit_options")) {YAHOO.util.Event.addListener(YAHOO.mc.optionsID, "click", displayOptions, optionObj);}YAHOO.namespace("fcue"); YAHOO.mc.FCUE_METADATA = {imInit:"",imSent:"",fcElap:"1254813133500",fcEcap:"2",fcNag:"",inEcap:"",inElap:""};YAHOO.mc.noCues = false;YAHOO.mc.msgrLoaded = false;YAHOO.mc.loadMsgr = function () {clearTimeout(YAHOO.mc.msgrLoadID);if (hasIM && !YAHOO.mc.msgrLoaded) {YAHOO.mc.msgrLoaded = true;YAHOO.util.Get.script("http://mail.yimg.com/d/combo?/mg/8_0_4/js/im_blue_all.js&/mg/8_0_4/js/us_strings.js&/mg/8_0_4/js/msgr.js");}};YAHOO.util.Event.on(window, "load", YAHOO.mc.loadMsgr);YAHOO.mc.msgrLoadID = setTimeout(YAHOO.mc.loadMsgr, 5000); if (YAHOO.mc.page.galaxy) { YAHOO.mc.page.galaxy.cleanup(); } YAHOO.mc.page.galaxy = new GalaxyHandler(); function myMsgHandler(fid, mid) { YAHOO.mc.page.galaxy.evtCallBack("showMessage?fid=" + fid + "&mid=" + mid + "&.rand=635860173"); } YAHOO.galaxy.setMsgListener(myMsgHandler); function myFolderHandler(fid, filterBy) { var filterUrl = ""; if (filterBy) { filterUrl += "&filterBy=" + filterBy; } YAHOO.mc.page.galaxy.evtCallBack("showFolder?fid=" + fid + filterUrl + "&.rand=635860173"); } YAHOO.galaxy.setFolderListener(myFolderHandler); gLaunchProfile.stop('LD_JS_BP', false);resizeLeftPane();gLaunchProfile.start('RT_AD_FOOT');



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net