Boost logo

Boost Users :

Subject: [Boost-users] boost::icl::contains question
From: Sanchay Harneja (sanchay.h_at_[hidden])
Date: 2017-02-09 10:44:38


Hi,

  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?

Thanks.



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