table: use boost::iterator_range in NameTree

refs #2155

Change-Id: I14efacf26aa1143177038fff3cf20d9d845f2c68
diff --git a/daemon/table/name-tree.hpp b/daemon/table/name-tree.hpp
index b4e12ed..6e936d0 100644
--- a/daemon/table/name-tree.hpp
+++ b/daemon/table/name-tree.hpp
@@ -80,7 +80,6 @@
 {
 public:
   class const_iterator;
-  class Range;
 
   explicit
   NameTree(size_t nBuckets = 1024);
@@ -186,7 +185,7 @@
    *  }
    *  \endcode
    */
-  Range
+  boost::iterator_range<const_iterator>
   findAllMatches(const Name& prefix,
                  const name_tree::EntrySelector& entrySelector = name_tree::AnyEntry()) const;
 
@@ -203,7 +202,7 @@
    *  }
    *  \endcode
    */
-  Range
+  boost::iterator_range<const_iterator>
   fullEnumerate(const name_tree::EntrySelector& entrySelector = name_tree::AnyEntry()) const;
 
   /** \brief Enumerate all entries under a prefix, optionally filtered by an EntrySubTreeSelector.
@@ -218,7 +217,7 @@
    *  }
    *  \endcode
    */
-  Range
+  boost::iterator_range<const_iterator>
   partialEnumerate(const Name& prefix,
                    const name_tree::EntrySubTreeSelector& entrySubTreeSelector =
                          name_tree::AnyEntrySubTree()) const;
@@ -276,32 +275,6 @@
     bool                                        m_shouldVisitChildren;
   };
 
-  /** \brief contains a pair of begin and end iterators
-   *
-   *  This is to be used with range-based for.
-   */
-  class Range
-  {
-  public:
-    Range(const_iterator begin, const_iterator end);
-
-    const_iterator
-    begin() const
-    {
-      return m_begin;
-    }
-
-    const_iterator
-    end() const
-    {
-      return m_end;
-    }
-
-  private:
-    const_iterator m_begin;
-    const_iterator m_end;
-  };
-
 private:
   /**
    * \brief Resize the hash table size when its load factor reaches a threshold.