
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. I tried to create a vector of set<Colour> references as follows. struct edge_properties { vector < set< Colour
& > eColours;
} But it did not compile. ( shouldn't it? ) Whats the best solution to this problem. Thanks - JR ReplyReply AllMove...InboxBGLGo to Previous message | Go to Next message | Back to Messages Select Message EncodingASCII (ASCII)Greek (ISO-8859-7)Greek (Windows-1253)Latin-10 (ISO-8859-16)Latin-3 (ISO-8859-3)Latin-6 (ISO-8859-10)Latin-7 (ISO-8859-13)Latin-8 (ISO-8859-14)Latin-9 (ISO-8859-15)W. European (850)W. European (CP858)W. European (HPROMAN8)W. European (MACROMAN8)W. European (Windows-1252)Armenia (ARMSCII-8)Baltic Rim (ISO-8859-4)Baltic Rim (WINDOWS-1257)Cyrillic (866)Cyrillic (ISO-8859-5)Cyrillic (KOI8-R)Cyrillic (KOI8-RU)Cyrillic (KOI8-T)Cyrillic (KOI8-U)Cyrillic (WINDOWS-1251)Latin-2 (852)Latin-2 (ISO-8859-2)Latin-2 (WINDOWS-1250)Turkish (ISO-8859-9)Turkish (WINDOWS-1254)Arabic (ISO-8859-6, ASMO-708)Arabic (WINDOWS-1256)Hebrew (856)Hebrew (862)Hebrew (WINDOWS-1255)Chinese Simplified (GB-2312-80)Chinese Simplified (GB18030)Chinese Simplified (HZ-GB-2312)Chinese Simplified (ISO-2022-CN)Chinese Simplified (WINDOWS-936)Chinese Trad.-Hong Kong (BIG5-HKSCS)Chinese Traditional (BIG5)Chinese Traditional (EUC-TW)Japanese (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');

At least before C++0X, a vector of references is not allowed. I'm not sure
about after C++0X (haven't dabbled much there yet).
Brian
On Thu, Oct 22, 2009 at 3:41 PM, John Robertson
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.
I tried to create a vector of set<Colour> references as follows.
struct edge_properties {
vector < set< Colour > & > eColours;
}
But it did not compile. ( shouldn't it? )
Whats the best solution to this problem.
Thanks - JR
ReplyReply AllMove...InboxBGL Go to Previous message | Go to Next messagehttp://us.mc1130.mail.yahoo.com/mc/showMessage;_ylc=X3oDMTBvZ2VoZGRnBF9TAzM5ODMwMTAyNwRhYwNuZXh0TWVzZw--?pSize=50&sMid=1&fid=Sent&mid=1_3121_AFSliGIAAUORSuDSxQJTwS0pp8I&sort=date&order=down&startMid=0&.rand=908945553&filterBy=&m=1_3121_AFSliGIAAUORSuDSxQJTwS0pp8I%2C1_159_AEqliGIAATfiSs%2BJCAfcxl5bBro%2C1_550_AE%2BliGIAAKAISs97NAk8PXBN9no%2C1_915_AFaliGIAAX1mSs97DwA9ChG9zKQ%2C1_1280_AFeliGIAAUYeSs96rQeQCmduuzA%2C| Back to Messageshttp://us.mc1130.mail.yahoo.com/mc/showFolder;_ylc=X3oDMTBvanRicmZwBF9TAzM5ODMwMTAyNwRhYwNiYWNrRnZldw--?fid=Sent&sort=date&order=down&startMid=0&.rand=908945553&filterBy= Select Message EncodingASCII (ASCII)Greek (ISO-8859-7)Greek (Windows-1253)Latin-10 (ISO-8859-16)Latin-3 (ISO-8859-3)Latin-6 (ISO-8859-10)Latin-7 (ISO-8859-13)Latin-8 (ISO-8859-14)Latin-9 (ISO-8859-15)W. European (850)W. European (CP858)W. European (HPROMAN8)W. European (MACROMAN8)W. European (Windows-1252)Armenia (ARMSCII-8)Baltic Rim (ISO-8859-4)Baltic Rim (WINDOWS-1257)Cyrillic (866)Cyrillic (ISO-8859-5)Cyrillic (KOI8-R)Cyrillic (KOI8-RU)Cyrillic (KOI8-T)Cyrillic (KOI8-U)Cyrillic (WINDOWS-1251)Latin-2 (852)Latin-2 (ISO-8859-2)Latin-2 (WINDOWS-1250)Turkish (ISO-8859-9)Turkish (WINDOWS-1254)Arabic (ISO-8859-6, ASMO-708)Arabic (WINDOWS-1256)Hebrew (856)Hebrew (862)Hebrew (WINDOWS-1255)Chinese Simplified (GB-2312-80)Chinese Simplified (GB18030)Chinese Simplified (HZ-GB-2312)Chinese Simplified (ISO-2022-CN)Chinese Simplified (WINDOWS-936)Chinese Trad.-Hong Kong (BIG5-HKSCS)Chinese Traditional (BIG5)Chinese Traditional (EUC-TW)Japanese (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 Headershttp://us.mc1130.mail.yahoo.com/mc/showMessage;_ylc=X3oDMTBvZnVubjh1BF9TAzM5ODMwMTAyNwRhYwNmdWxIZWFkcg--?sMid=0&fid=Sent&filterBy=&.rand=908945553&midIndex=0&mid=1_3437_AEqliGIAAPlNSuDedwcoI3UeiZI&f=1&m=1_3437_AEqliGIAAPlNSuDedwcoI3UeiZI%2C1_3121_AFSliGIAAUORSuDSxQJTwS0pp8I%2C1_159_AEqliGIAATfiSs%2BJCAfcxl5bBro%2C1_550_AE%2BliGIAAKAISs97NAk8PXBN9no%2C1_915_AFaliGIAAX1mSs97DwA9ChG9zKQ%2C1_1280_AFeliGIAAUYeSs96rQeQCmduuzA%2C&sort=date&order=down&startMid=0&pSize=50&hash=662aef68b7f933d737c509ba02759e8d&.jsrand=3685759&acrumb=K.EKbMWnUQD&mcrumb=erLrHYy4UH1&enc=auto&head=f
Mail Search
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Brian Budge
-
John Robertson