[llvm] [ADT] Fix llvm::concat_iterator for `ValueT == common_base_class *` (PR #144744)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 17 06:21:22 PDT 2025
================
@@ -978,6 +978,17 @@ detail::zip_longest_range<T, U, Args...> zip_longest(T &&t, U &&u,
std::forward<T>(t), std::forward<U>(u), std::forward<Args>(args)...);
}
+/// `all_types_same_as::value == true` if all types in `OtherTs` are same as
+/// `FirstT`, ignoring cv-qualifiers.
+template <typename FirstT, typename... OtherTs> struct all_types_same_as {
+ static constexpr bool value =
+ (std::is_same_v<std::remove_cv_t<OtherTs>, std::remove_cv_t<FirstT>> &&
+ ...);
+};
+template <typename FirstT, typename... OtherTs>
+constexpr bool all_types_same_as_v =
+ all_types_same_as<FirstT, OtherTs...>::value;
----------------
kuhar wrote:
Could you drop `remove_cv_t` and strip it on the caller side? Also, I'd call it `all_equal_types`, similar to the `llvm::all_equal` function
https://github.com/llvm/llvm-project/pull/144744
More information about the llvm-commits
mailing list