range_map: Add a method to find which range a single value falls into.
authorNathan Binkert <nate@binkert.org>
Fri, 10 Oct 2008 05:19:38 +0000 (22:19 -0700)
committerNathan Binkert <nate@binkert.org>
Fri, 10 Oct 2008 05:19:38 +0000 (22:19 -0700)
src/base/range_map.hh

index 1c121925df108df39a503cc0ce6d25b60f86b951..0ffc28ed995ef1b3e7526d95b8dc66ab3e86f30c 100644 (file)
@@ -69,6 +69,13 @@ class range_map
         return tree.end();
     }
 
+    template <class U>
+    const iterator
+    find(const U &r)
+    {
+        return find(RangeSize(r, 1));
+    }
+
     template <class U>
     bool
     intersect(const Range<U> &r)