[libc-commits] [PATCH] D135540: clean up std::iterator in LibcBenchmark.h

Schrodinger ZHU Yifan via Phabricator via libc-commits libc-commits at lists.llvm.org
Sun Oct 9 09:27:32 PDT 2022


SchrodingerZhu created this revision.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
SchrodingerZhu requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135540

Files:
  libc/benchmarks/LibcBenchmark.h


Index: libc/benchmarks/LibcBenchmark.h
===================================================================
--- libc/benchmarks/LibcBenchmark.h
+++ libc/benchmarks/LibcBenchmark.h
@@ -38,6 +38,8 @@
 #include <chrono>
 #include <cmath>
 #include <cstdint>
+#include <iterator>
+#include <sys/types.h>
 
 namespace llvm {
 namespace libc_benchmarks {
@@ -272,8 +274,8 @@
   using difference_type = ssize_t;
   using size_type = size_t;
 
-  class const_iterator
-      : public std::iterator<std::input_iterator_tag, T, ssize_t> {
+  class const_iterator {
+    using iterator_category = std::input_iterator_tag;
     llvm::ArrayRef<T> Array;
     size_t Index;
     size_t Offset;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135540.466380.patch
Type: text/x-patch
Size: 679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221009/29fc73ca/attachment.bin>


More information about the libc-commits mailing list