Had this:
rtable.insert ( pair<string,string>(destination,nhop) ); // route insertion
return 0;
Changed it to this:
if (rtable.insert ( pair<string,string>(destination,nhop)) == 0){
return 0;
}
First one compiles fine. Second one gives me a make error 1. I can go back and forth all day — I can’t see any issues. Any ideas?
That overload of
std::map::insert()returns astd::pair<iterator, bool>. You can’t compare that against zero.That
boolelement tells you whether a new element was inserted; if you want to compare against that you can simply use: