<Interval_sets>и<interval_maps>могут быть заполнены и обработаны с помощью операций с установленным стилем, таких как союз<+=>, разница<-=>и пересечение<&=>.
В этом примеречеловеко-силаряд таких операций демонстрируется в процессе расчета имеющегося рабочего времени (человеко-силы) сотрудников компании, учитывающего выходные, праздничные дни, время болезни и отпуска.
#include <boost/icl/gregorian.hpp>
#include <iostream>
#include <boost/icl/discrete_interval.hpp>
#include <boost/icl/interval_map.hpp>
using namespace std;
using namespace boost::gregorian;
using namespace boost::icl;
interval_set<date> weekends(const discrete_interval<date>& scope)
{
    interval_set<date> weekends;
    date cur_weekend_sat
        = first(scope)
          + days(days_until_weekday(first(scope), greg_weekday(Saturday)))
          - weeks(1);
    week_iterator week_iter(cur_weekend_sat);
    for(; week_iter <= last(scope); ++week_iter)
        weekends += discrete_interval<date>::right_open(*week_iter, *week_iter + days(2));
    weekends &= scope; 
    return weekends;
}
void man_power()
{
    date someday = from_string("2008-08-01");
    date thenday = someday + months(3);
    discrete_interval<date> scope = discrete_interval<date>::right_open(someday, thenday);
    
    
    
    
    interval_set<date> worktime(scope);
    
    worktime -= weekends(scope);
    
    worktime -= from_string("2008-10-03"); 
    
    worktime -= discrete_interval<date>::closed(from_string("2008-08-18"),
                                                from_string("2008-08-22"));
    
    
    
    
    
    interval_map<date,int> claudias_working_hours;
    
    
    claudias_working_hours += make_pair(scope, 8);
    
    
    claudias_working_hours &= worktime;
    
    discrete_interval<date> claudias_seminar (from_string("2008-09-16"),
                                              from_string("2008-09-24"),
                                              interval_bounds::closed());
    discrete_interval<date> claudias_vacation(from_string("2008-08-01"),
                                              from_string("2008-08-14"),
                                              interval_bounds::closed());
    interval_set<date> claudias_absence_times(claudias_seminar);
    claudias_absence_times += claudias_vacation;
    
    claudias_working_hours -= claudias_absence_times;
    
    
    
    interval_map<date,int> bodos_working_hours;
    
    bodos_working_hours += make_pair(scope, 4);
    
    bodos_working_hours &= worktime;
    
    discrete_interval<date>      bodos_flu(from_string("2008-09-19"), from_string("2008-09-29"),
                                           interval_bounds::closed());
    discrete_interval<date> bodos_vacation(from_string("2008-08-15"), from_string("2008-09-03"),
                                           interval_bounds::closed());
    interval_set<date> bodos_absence_times(bodos_flu);
    bodos_absence_times += bodos_vacation;
    
    bodos_working_hours -= bodos_absence_times;
    
    
    
    
    interval_map<date,int> manpower;
    manpower += claudias_working_hours;
    manpower += bodos_working_hours;
    cout << first(scope) << " - " << last(scope)
         << "    available man-power:" << endl;
    cout << "---------------------------------------------------------------\n";
    for(interval_map<date,int>::iterator it = manpower.begin();
        it != manpower.end(); it++)
    {
        cout << first(it->first) << " - " << last(it->first)
             << " -> " << it->second << endl;
    }
}
int main()
{
    cout << ">>Interval Container Library: Sample man_power.cpp <<\n";
    cout << "---------------------------------------------------------------\n";
    man_power();
    return 0;
}