[libc-commits] [PATCH] D131610: [libc][NFC] add arrow operator to optional

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 10 12:00:40 PDT 2022


michaelrj created this revision.
michaelrj added a reviewer: sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
michaelrj requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131610

Files:
  libc/src/__support/CPP/optional.h


Index: libc/src/__support/CPP/optional.h
===================================================================
--- libc/src/__support/CPP/optional.h
+++ libc/src/__support/CPP/optional.h
@@ -74,6 +74,8 @@
   constexpr T &operator*() & { return Storage.StoredValue; }
 
   constexpr const T &operator*() const & { return Storage.StoredValue; }
+
+  constexpr const T *operator->() const { return &Storage.StoredValue; }
 };
 } // namespace cpp
 } // namespace __llvm_libc


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131610.451595.patch
Type: text/x-patch
Size: 469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220810/3fd403ba/attachment.bin>


More information about the libc-commits mailing list