Details
- Reviewers
sivachandra - Commits
- rG42e2946f51e3: [libc][NFC] add arrow operator to optional
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Good to go after adding smoke tests.
libc/src/__support/CPP/optional.h | ||
---|---|---|
78 | For consistency with operator*, make it const & and add a non-const & flavor also. |
add tests and non-const version
libc/src/__support/CPP/optional.h | ||
---|---|---|
78 | If I change this to be a reference, then to use the -> operator the contained object must also support the -> operator. Here's the error message when I try it: I think it's more useful to leave it as is, so that it works as expected without additional effort. |
For consistency with operator*, make it const & and add a non-const & flavor also.