[all-commits] [llvm/llvm-project] 546449: [libcxx][optional] adds missing constexpr operations
Christopher Di Bella via All-commits
all-commits at lists.llvm.org
Wed Jun 9 22:53:22 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 546449938a39dcc65f60f8d6e44e7b058a026549
https://github.com/llvm/llvm-project/commit/546449938a39dcc65f60f8d6e44e7b058a026549
Author: Christopher Di Bella <cjdb at google.com>
Date: 2021-06-10 (Thu, 10 Jun 2021)
Changed paths:
M libcxx/docs/Cxx2aStatusPaperStatus.csv
M libcxx/include/optional
M libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.assign/optional_U.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/const_optional_U.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_const_optional_U.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_optional_U.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/optional_U.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
M libcxx/test/std/utilities/optional/optional.object/optional.object.swap/swap.pass.cpp
Log Message:
-----------
[libcxx][optional] adds missing constexpr operations
Makes the following operations constexpr:
* `std::swap(optional, optional)`
* `optional(optional<U> const&)`
* `optional(optional<U>&&)`
* `~optional()`
* `operator=(nullopt_t)`
* `operator=(U&&)`
* `operator=(optional<U> const&)`
* `operator=(optional<U>&&)`
* `emplace(Args&&...)`
* `emplace(initializer_list<U>, Args&&...)`
* `swap(optional&)`
* `reset()`
P2231 has been accepted by plenary, with the committee recommending
implementers retroactively apply to C++20. It's necessary for us to
implement _`semiregular-box`_ and _`non-propagating-cache`_, both of
which are required for ranges (otherwise we'll need to reimplement
`std::optional` with these members `constexpr`ified).
Differential Revision: https://reviews.llvm.org/D102119
More information about the All-commits
mailing list