1
  boost::icl::interval_map<int, boost::icl::interval_map<int, boost::icl::interval_set<int>>> larger, smaller; 

  larger.add(make_pair(boost::icl::discrete_interval<int>::closed(102,104), 
      boost::icl::interval_map<int, boost::icl::interval_set<int>>{ 
          make_pair(boost::icl::discrete_interval<int>::closed(0,0), boost::icl::interval_set<int {boost::icl::discrete_interval<int>::closed(2,4)})})); 

  smaller.add(make_pair(boost::icl::discrete_interval<int>::closed(103,103), 
      boost::icl::interval_map<int, boost::icl::interval_set<int>>{ 
          make_pair(boost::icl::discrete_interval<int>::closed(0,0), boost::icl::interval_set<int>{boost::icl::discrete_interval<int>::closed(3,3)})})); 

  cout << larger << endl; 
  cout << smaller << endl; 
  cout << boost::icl::contains(larger, smaller) << endl; 
  cout << ((smaller & larger) == smaller) << endl; 

As given above, I'm trying to check if smaller is subset of larger. But I get following output:

{([102,104]->{([0,0]->{[2,4]})})} 
{([103,103]->{([0,0]->{[3,3]})})} 
0 
1 

Any reason why boost::icl::contains(larger, smaller) doesn't work but ((smaller & larger) == smaller) works?

na_ka_na
  • 1,558
  • 1
  • 12
  • 15
  • What version of boost are you using? What version of C++ are you using? You should post a MWE that compiles so users can help you easily. – miravalls Jan 04 '18 at 16:42

0 Answers0