summaryrefslogtreecommitdiffstats
path: root/libcxx/src/optional.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Put the exception classes for experimental::optional and experimental::any ↵Marshall Clow2018-02-011-0/+20
| | | | | | back in the dylib for binary compatibility llvm-svn: 323989
* Remove <experimental/optional>; use <optional> instead. See ↵Marshall Clow2018-02-011-6/+0
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323971
* Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are ↵Marshall Clow2017-02-051-2/+2
| | | | | | noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today. llvm-svn: 294142
* Change the base class of std::bad_optional_access. This is a (subtle) ABI ↵Marshall Clow2017-02-051-2/+6
| | | | | | change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error. llvm-svn: 294133
* Implement N4606 optionalEric Fiselier2016-10-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adapt implementation of Library Fundamentals TS optional into an implementation of N4606 optional. - Update relational operators per http://wg21.link/P0307 - Update to requirements of http://wg21.link/P0032 - Extension: Implement trivial copy/move construction/assignment for `optional<T>` when `T` is trivially copyable. Audit P/Rs for optional LWG issues: - 2756 "C++ WP optional<T> should 'forward' T's implicit conversions" Implemented, which also resolves 2753 "Optional's constructors and assignments need constraints" (modulo my refusal to explicitly delete the move operations, which is a design error that I'm working on correcting in the 2756 P/R). - 2736 "nullopt_t insufficiently constrained" Already conforming. I've added a test ensuring that `nullopt_t` is not copy-initializable from an empty braced-init-list, which I believe is the root intent of the issue, to avoid regression. - 2740 "constexpr optional<T>::operator->" Already conforming. - 2746 "Inconsistency between requirements for emplace between optional and variant" No P/R, but note that the author's '"suggested resolution" is already implemented. - 2748 "swappable traits for optionals" Already conforming. - 2753 "Optional's constructors and assignments need constraints" Implemented. Most of the work for this patch was done by Casey Carter @ Microsoft. Thank you Casey! Reviewers: mclow.lists, CaseyCarter, EricWF Differential Revision: https://reviews.llvm.org/D22741 llvm-svn: 283980
* Revert Add <optional>. Will recommit with better commit messageEric Fiselier2016-10-121-6/+6
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-121-6/+6
| | | | | | | | This patch is largely thanks to Casey Carter @ Microsoft. He did the initial work of porting our experimental implementation and tests over to namespace std. llvm-svn: 283977
* Add all the relational operators to std::experimental::optional. Also update ↵Marshall Clow2014-12-091-3/+2
| | | | | | bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though. llvm-svn: 223775
* Move <optional> into include/experimental, and into the std::experimental ↵Marshall Clow2013-11-151-3/+3
| | | | | | namespace, since it's not part of C++14, but of an upcoming TS llvm-svn: 194867
* Evgeniy Stepanov: Add noexcept to ~bad_optional_access() to silence warning ↵Howard Hinnant2013-09-041-2/+2
| | | | | | during build. llvm-svn: 189949
* Implement N3672, optional<T>.Howard Hinnant2013-09-021-0/+25
llvm-svn: 189772
OpenPOWER on IntegriCloud