From e3bdfe639cf4ad5f180730d8bec31eba251d349d Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 17 Apr 2017 20:15:16 +0000 Subject: [optional] Update synopsis for LWG2934 (comment-only change) llvm-svn: 300488 --- libcxx/include/optional | 78 +++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 38 deletions(-) (limited to 'libcxx/include/optional') diff --git a/libcxx/include/optional b/libcxx/include/optional index 118d7178288..8c7a242113a 100644 --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -17,29 +17,31 @@ // C++1z namespace std { - // 20.6.3, optional for object types + // 23.6.3, optional for object types template class optional; - // 20.6.4, no-value state indicator + // 23.6.4, no-value state indicator struct nullopt_t{see below }; constexpr nullopt_t nullopt(unspecified ); - // 20.6.5, class bad_optional_access + // 23.6.5, class bad_optional_access class bad_optional_access; - // 20.6.6, relational operators - template - constexpr bool operator==(const optional&, const optional&); - template - constexpr bool operator!=(const optional&, const optional&); - template - constexpr bool operator<(const optional&, const optional&); - template - constexpr bool operator>(const optional&, const optional&); - template - constexpr bool operator<=(const optional&, const optional&); - template - constexpr bool operator>=(const optional&, const optional&); + // 23.6.6, relational operators + template + constexpr bool operator==(const optional&, const optional&); + template + constexpr bool operator!=(const optional&, const optional&); + template + constexpr bool operator<(const optional&, const optional&); + template + constexpr bool operator>(const optional&, const optional&); + template + constexpr bool operator<=(const optional&, const optional&); + template + constexpr bool operator>=(const optional&, const optional&); + + // 23.6.7 comparison with nullopt template constexpr bool operator==(const optional&, nullopt_t) noexcept; template constexpr bool operator==(nullopt_t, const optional&) noexcept; template constexpr bool operator!=(const optional&, nullopt_t) noexcept; @@ -53,21 +55,21 @@ namespace std { template constexpr bool operator>=(const optional&, nullopt_t) noexcept; template constexpr bool operator>=(nullopt_t, const optional&) noexcept; - // 20.6.8, comparison with T - template constexpr bool operator==(const optional&, const T&); - template constexpr bool operator==(const T&, const optional&); - template constexpr bool operator!=(const optional&, const T&); - template constexpr bool operator!=(const T&, const optional&); - template constexpr bool operator<(const optional&, const T&); - template constexpr bool operator<(const T&, const optional&); - template constexpr bool operator<=(const optional&, const T&); - template constexpr bool operator<=(const T&, const optional&); - template constexpr bool operator>(const optional&, const T&); - template constexpr bool operator>(const T&, const optional&); - template constexpr bool operator>=(const optional&, const T&); - template constexpr bool operator>=(const T&, const optional&); - - // 20.6.9, specialized algorithms + // 23.6.8, comparison with T + template constexpr bool operator==(const optional&, const U&); + template constexpr bool operator==(const U&, const optional&); + template constexpr bool operator!=(const optional&, const U&); + template constexpr bool operator!=(const U&, const optional&); + template constexpr bool operator<(const optional&, const U&); + template constexpr bool operator<(const U&, const optional&); + template constexpr bool operator<=(const optional&, const U&); + template constexpr bool operator<=(const U&, const optional&); + template constexpr bool operator>(const optional&, const U&); + template constexpr bool operator>(const U&, const optional&); + template constexpr bool operator>=(const optional&, const U&); + template constexpr bool operator>=(const U&, const optional&); + + // 23.6.9, specialized algorithms template void swap(optional&, optional&) noexcept(see below ); template constexpr optional make_optional(T&&); template @@ -75,7 +77,7 @@ namespace std { template constexpr optional make_optional(initializer_list il, Args&&... args); - // 20.6.10, hash support + // 23.6.10, hash support template struct hash; template struct hash>; @@ -83,7 +85,7 @@ namespace std { public: using value_type = T; - // 20.6.3.1, constructors + // 23.6.3.1, constructors constexpr optional() noexcept; constexpr optional(nullopt_t) noexcept; optional(const optional &); @@ -98,10 +100,10 @@ namespace std { template constexpr EXPLICIT optional(optional &&); - // 20.6.3.2, destructor + // 23.6.3.2, destructor ~optional(); - // 20.6.3.3, assignment + // 23.6.3.3, assignment optional &operator=(nullopt_t) noexcept; optional &operator=(const optional &); optional &operator=(optional &&) noexcept(see below ); @@ -112,10 +114,10 @@ namespace std { template T& emplace(initializer_list, Args &&...); - // 20.6.3.4, swap + // 23.6.3.4, swap void swap(optional &) noexcept(see below ); - // 20.6.3.5, observers + // 23.6.3.5, observers constexpr T const *operator->() const; constexpr T *operator->(); constexpr T const &operator*() const &; @@ -131,7 +133,7 @@ namespace std { template constexpr T value_or(U &&) const &; template constexpr T value_or(U &&) &&; - // 20.6.3.6, modifiers + // 23.6.3.6, modifiers void reset() noexcept; private: -- cgit v1.2.3