[PATCH] D152891: [ADT] Add deduction guide for iterator_range

Balázs Benics via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 23:42:19 PDT 2023


steakhal created this revision.
steakhal added reviewers: rnk, dblaikie.
Herald added a subscriber: martong.
Herald added a project: All.
steakhal requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152891

Files:
  llvm/include/llvm/ADT/iterator_range.h


Index: llvm/include/llvm/ADT/iterator_range.h
===================================================================
--- llvm/include/llvm/ADT/iterator_range.h
+++ llvm/include/llvm/ADT/iterator_range.h
@@ -46,6 +46,10 @@
   bool empty() const { return begin_iterator == end_iterator; }
 };
 
+template <typename Container>
+iterator_range(Container &&)
+    -> iterator_range<decltype(std::declval<Container>().begin())>;
+
 /// Convenience function for iterating over sub-ranges.
 ///
 /// This provides a bit of syntactic sugar to make using sub-ranges


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152891.531197.patch
Type: text/x-patch
Size: 553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230614/7f45ed47/attachment.bin>


More information about the llvm-commits mailing list