[PATCH] D23178: [ADT] Add relation operators for Optional

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 15:24:09 PDT 2016


timshen marked 2 inline comments as done.

================
Comment at: include/llvm/ADT/Optional.h:155
@@ +154,3 @@
+bool operator==(const Optional<T> &X, const Optional<U> &Y) {
+  if (X && Y)
+    return *X == *Y;
----------------
Done. For the context that enforces a cast, I used X.hasValue() instead of bool(X); in other cases I used implicit conversion.


https://reviews.llvm.org/D23178





More information about the llvm-commits mailing list