[libc] Trivial implementation of std::optional
authorJeff Bailey <jeffbailey@google.com>
Fri, 5 Aug 2022 02:44:02 +0000 (02:44 +0000)
committerJeff Bailey <jeffbailey@google.com>
Fri, 5 Aug 2022 02:51:44 +0000 (02:51 +0000)
commit3b631e47fe4cfc366fd107c748e6ac01b4f5974a
tree89509d857f1f7da7415163bc7ee376da52947099
parent40d74fcb552cef7c78d6dfc36d574440f6ea0e4c
[libc] Trivial implementation of std::optional

This class has only the minimum functionality in it to provide what the
TZ variable parsing needs.  In particular, the standard makes guarantees
about how trivial the destructors are, throws an expception if it's used
incorrectly, etc.  There are also missing features.

Tested:
Trivial testsuite added, and use in development.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D129920
libc/src/__support/CPP/CMakeLists.txt
libc/src/__support/CPP/optional.h [new file with mode: 0644]
libc/test/src/__support/CPP/CMakeLists.txt
libc/test/src/__support/CPP/optional_test.cpp [new file with mode: 0644]
utils/bazel/llvm-project-overlay/libc/BUILD.bazel