User Profile

Collapse

Profile Sidebar

Collapse
wangkhem
wangkhem
Last Activity: Apr 26 '10, 08:46 AM
Joined: Jan 27 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks for your kind reply. Sorry for not being clear with my question. Im not considering the case when map is empty it ll be handled separately.
    The following code will excutes fine.
    Code:
    void fn(map<string, string> &m, map<string, string>::iterator i) {
        cout << "i->first: " << i->first << endl;
        if (++i == m.end()) {
            end();
        } else {
    ...
    See more | Go to post

    Leave a comment:


  • wangkhem
    started a topic Iterating on std::map results in segmentation fault
    in C

    Iterating on std::map results in segmentation fault

    Code:
    void call(function<void ()> f) {
        f();
    }
    void end() {
        cout << "End..." << endl;
    }
    void fn(map<string, string> &m, map<string, string>::iterator i) {
        cout << "i->first: " << i->first << endl;
        if (++i == m.end()) {
            end();
        } else {
            call(bind(&fn, m, i));
    ...
    See more | Go to post
No activity results to display
Show More
Working...