[libcxx-commits] [libcxx] 401e9e4 - [libc++][ranges][NFC] Templatize some of the types in `almost_satisfies_types.h`
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 12 14:14:43 PDT 2023
Author: varconst
Date: 2023-04-12T14:13:55-07:00
New Revision: 401e9e42916b0926465f35544b6cdadcbd8e36b4
URL: https://github.com/llvm/llvm-project/commit/401e9e42916b0926465f35544b6cdadcbd8e36b4
DIFF: https://github.com/llvm/llvm-project/commit/401e9e42916b0926465f35544b6cdadcbd8e36b4.diff
LOG: [libc++][ranges][NFC] Templatize some of the types in `almost_satisfies_types.h`
Added:
Modified:
libcxx/test/support/almost_satisfies_types.h
Removed:
################################################################################
diff --git a/libcxx/test/support/almost_satisfies_types.h b/libcxx/test/support/almost_satisfies_types.h
index 4c9583b0b582e..296dbb6de6180 100644
--- a/libcxx/test/support/almost_satisfies_types.h
+++ b/libcxx/test/support/almost_satisfies_types.h
@@ -25,17 +25,22 @@ class UncheckedRange {
static_assert(std::ranges::contiguous_range<UncheckedRange<int*, int*>>);
// almost an input_iterator
-class InputIteratorNotDerivedFrom {
+template <class T>
+class InputIteratorNotDerivedFromGeneric {
public:
using
diff erence_type = long;
- using value_type = int;
+ using value_type = T;
using iterator_category = void;
- InputIteratorNotDerivedFrom& operator++();
+ InputIteratorNotDerivedFromGeneric& operator++();
void operator++(int);
- const int& operator*() const;
+ const T& operator*() const;
};
+using InputIteratorNotDerivedFrom = InputIteratorNotDerivedFromGeneric<int>;
+
+template <class T>
+using InputRangeNotDerivedFromGeneric = UncheckedRange<InputIteratorNotDerivedFromGeneric<T>>;
using InputRangeNotDerivedFrom = UncheckedRange<InputIteratorNotDerivedFrom>;
static_assert(std::input_or_output_iterator<InputIteratorNotDerivedFrom>);
More information about the libcxx-commits
mailing list