| 1 | #include "precomp.hpp" // Precompiled header.
|
|---|
| 2 | #include <iostream>
|
|---|
| 3 | #include <functional>
|
|---|
| 4 | #include <boost/cstdint.hpp>
|
|---|
| 5 | #include <boost/icl/closed_interval.hpp>
|
|---|
| 6 | #include <boost/icl/split_interval_set.hpp>
|
|---|
| 7 |
|
|---|
| 8 | void main()
|
|---|
| 9 | {
|
|---|
| 10 | using namespace std;
|
|---|
| 11 | typedef boost::icl::closed_interval<boost::uint16_t, std::less> interval_t;
|
|---|
| 12 | typedef boost::icl::split_interval_set<boost::uint16_t, std::less, interval_t> set_t;
|
|---|
| 13 |
|
|---|
| 14 | set_t s;
|
|---|
| 15 |
|
|---|
| 16 | s.clear();
|
|---|
| 17 | s += interval_t(0x0000, 0xffff);
|
|---|
| 18 | s += interval_t(0xa000, 0xbfff);
|
|---|
| 19 | cout << "BAD: " << hex << s << endl;
|
|---|
| 20 |
|
|---|
| 21 | s.clear();
|
|---|
| 22 | s += interval_t(0x0000, 0xfffe);
|
|---|
| 23 | s += interval_t(0xa000, 0xbfff);
|
|---|
| 24 | cout << "GOOD: " << hex << s << endl;
|
|---|
| 25 | }
|
|---|