Эх сурвалжийг харах

feat(std::set): add template key version of lower_bound

greatbridf 1 жил өмнө
parent
commit
281050186a
1 өөрчлөгдсөн 16 нэмэгдсэн , 0 устгасан
  1. 16 0
      gblibstdc++/include/set

+ 16 - 0
gblibstdc++/include/set

@@ -190,6 +190,14 @@ public:
     __GBLIBCPP_CONSTEXPR
     const_iterator upper_bound(const Key& key) const
     { return tree.upper_bound(key); }
+    template <typename K>
+    __GBLIBCPP_CONSTEXPR
+    iterator upper_bound(const K& key)
+    { return tree.upper_bound(key); }
+    template <typename K>
+    __GBLIBCPP_CONSTEXPR
+    const_iterator upper_bound(const K& key) const
+    { return tree.upper_bound(key); }
 
     __GBLIBCPP_CONSTEXPR
     iterator lower_bound(const Key& key)
@@ -197,6 +205,14 @@ public:
     __GBLIBCPP_CONSTEXPR
     const_iterator lower_bound(const Key& key) const
     { return tree.lower_bound(key); }
+    template <typename K>
+    __GBLIBCPP_CONSTEXPR
+    iterator lower_bound(const K& key)
+    { return tree.lower_bound(key); }
+    template <typename K>
+    __GBLIBCPP_CONSTEXPR
+    const_iterator lower_bound(const K& key) const
+    { return tree.lower_bound(key); }
 };
 
 template <typename Key, typename Compare, typename Allocator>