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;
如上所述,我试图检查较小的是较大的子集。但是我 得到以下输出:
{([102,104]->{([0,0]->{[2,4]})})}
{([103,103]->{([0,0]->{[3,3]})})}
0
1
boost::icl::contains(larger, smaller)
无法正常工作的原因
((smaller & larger) == smaller)
有效吗?