From fac1ce10507107fc351e0b9773fa9bc36a40010a Mon Sep 17 00:00:00 2001 From: Alexander Stram Date: Mon, 27 Aug 2018 18:05:29 -0700 Subject: [PATCH] Update Usage example to new syntax --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ed000d0..fb88a2b 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,20 @@ Add `#include "IntervalTree.h"` to the source files in which you will use the in To make an IntervalTree to contain objects of class T, use: ```c++ -vector > intervals; +IntervalTree::interval_vector intervals; T a, b, c; -intervals.push_back(Interval(2, 10, a)); -intervals.push_back(Interval(3, 4, b)); -intervals.push_back(Interval(20, 100, c)); -IntervalTree tree; -tree = IntervalTree(intervals); +intervals.push_back(IntervalTree::interval(2, 10, a)); +intervals.push_back(IntervalTree::interval(3, 4, b)); +intervals.push_back(IntervalTree::interval(20, 100, c)); +IntervalTree tree; +tree = IntervalTree(move(intervals)); ``` Now, it's possible to query the tree and obtain a set of intervals which are contained within the start and stop coordinates. ```c++ -vector > results; -tree.findContained(start, stop, results); +IntervalTree::interval_vector results; +results = tree.findContained(start, stop); cout << "found " << results.size() << " overlapping intervals" << endl; ```