Boost logo

Boost Users :

Subject: [Boost-users] Having trouble compiling interval_map
From: Daniel Rubi (daniel_rubi_at_[hidden])
Date: 2013-12-04 20:00:46


Hi, I'm trying to implement an interval map where the keys are close_interval<long> an the values are set<string>. I modified the party example according to my needs, and came up with this short code: #include <boost/icl/interval.hpp> #include <boost/icl/interval_map.hpp> #include <boost/compressed_pair.hpp> using namespace std; using namespace boost::icl; typedef std::set<string> ids; int main(int argc, char* argv[]) {  ids ids1;   ids1.insert("T1");  ids ids2;  ids2.insert("T2");  interval_map<closed_interval<long>, ids> mymap;  closed_interval<long> i1 = closed_interval<long>(2, 7);  closed_interval<long> i2 = closed_interval<long>(3, 8);  mymap.insert(std::pair<closed_interval<long>, ids>(i1,ids1));  mymap.insert(std::pair<closed_interval<long>, ids>(i2,ids2));  return 0; } However, I get this compilation error: call of overloaded ‘insert(std::pair<boost::icl::closed_interval<long int>, std::set<std::basic_string<char> > >)’ is ambiguous   mymap.insert(std::pair<closed_interval<long>, ids>(i2,ids2)); This is after getting compiation errors trying ti use: mymap += make_pair(i1,ids1); Any idea what's wrong?



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