[Mlir-commits] [mlir] [mlir] Use {} instead of std::nullopt to initialize empty ArrayRef (PR #109527)
Jay Foad
llvmlistbot at llvm.org
Sat Sep 21 02:54:22 PDT 2024
================
@@ -47,6 +47,7 @@ class TypeRange : public llvm::detail::indexed_accessor_range_base<
template <typename Arg, typename = std::enable_if_t<std::is_constructible<
ArrayRef<Type>, Arg>::value>>
TypeRange(Arg &&arg) : TypeRange(ArrayRef<Type>(std::forward<Arg>(arg))) {}
+ TypeRange(std::nullopt_t) : TypeRange(ArrayRef<Type>()) {}
----------------
jayfoad wrote:
For `TypeRange` and `ValueRange` I opted to allow clients to continue to pass in `std::nullopt` to get an empty range, to avoid chasing too far down the rabbit hole.
https://github.com/llvm/llvm-project/pull/109527
More information about the Mlir-commits
mailing list