From e3bdfe639cf4ad5f180730d8bec31eba251d349d Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 17 Apr 2017 20:15:16 +0000 Subject: [PATCH] [optional] Update synopsis for LWG2934 (comment-only change) llvm-svn: 300488 --- libcxx/include/optional | 76 ++++++++++--------- .../optional.comp_with_t/equal.pass.cpp | 4 +- .../optional.comp_with_t/greater.pass.cpp | 4 +- .../greater_equal.pass.cpp | 4 +- .../optional.comp_with_t/less_equal.pass.cpp | 4 +- .../optional.comp_with_t/less_than.pass.cpp | 4 +- .../optional.comp_with_t/not_equal.pass.cpp | 4 +- .../optional/optional.relops/equal.pass.cpp | 2 +- .../optional.relops/greater_equal.pass.cpp | 2 +- .../optional.relops/greater_than.pass.cpp | 2 +- .../optional.relops/less_equal.pass.cpp | 2 +- .../optional.relops/less_than.pass.cpp | 2 +- .../optional.relops/not_equal.pass.cpp | 2 +- 13 files changed, 57 insertions(+), 55 deletions(-) diff --git a/libcxx/include/optional b/libcxx/include/optional index 118d71782882..8c7a242113a0 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&); + // 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&); - // 20.6.9, specialized algorithms + // 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: diff --git a/libcxx/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp index 29fb7a8431f1..dc69739271b5 100644 --- a/libcxx/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator==(const optional& x, const T& v); -// template constexpr bool operator==(const T& v, const optional& x); +// template constexpr bool operator==(const optional& x, const U& v); +// template constexpr bool operator==(const U& v, const optional& x); #include diff --git a/libcxx/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp b/libcxx/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp index ae34eb20517e..e1bad12e3f69 100644 --- a/libcxx/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator>(const optional& x, const T& v); -// template constexpr bool operator>(const T& v, const optional& x); +// template constexpr bool operator>(const optional& x, const U& v); +// template constexpr bool operator>(const U& v, const optional& x); #include diff --git a/libcxx/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp index dac94002661f..342ddffc2c79 100644 --- a/libcxx/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator>=(const optional& x, const T& v); -// template constexpr bool operator>=(const T& v, const optional& x); +// template constexpr bool operator>=(const optional& x, const U& v); +// template constexpr bool operator>=(const U& v, const optional& x); #include diff --git a/libcxx/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp index b71f8363b0a6..bcf6afcc6bfb 100644 --- a/libcxx/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator<=(const optional& x, const T& v); -// template constexpr bool operator<=(const T& v, const optional& x); +// template constexpr bool operator<=(const optional& x, const U& v); +// template constexpr bool operator<=(const U& v, const optional& x); #include diff --git a/libcxx/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp b/libcxx/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp index 84456b3baa6e..3d5e2144a967 100644 --- a/libcxx/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator<(const optional& x, const T& v); -// template constexpr bool operator<(const T& v, const optional& x); +// template constexpr bool operator<(const optional& x, const U& v); +// template constexpr bool operator<(const U& v, const optional& x); #include diff --git a/libcxx/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp index a4ffdc25e721..7da9b7ba7a03 100644 --- a/libcxx/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator!=(const optional& x, const T& v); -// template constexpr bool operator!=(const T& v, const optional& x); +// template constexpr bool operator!=(const optional& x, const U& v); +// template constexpr bool operator!=(const U& v, const optional& x); #include diff --git a/libcxx/test/std/utilities/optional/optional.relops/equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.relops/equal.pass.cpp index 7667540f9760..0752841d3668 100644 --- a/libcxx/test/std/utilities/optional/optional.relops/equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.relops/equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator==(const optional& x, const optional& y); +// template constexpr bool operator==(const optional& x, const optional& y); #include #include diff --git a/libcxx/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp index 0e05834c147a..f475f3796916 100644 --- a/libcxx/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator>= (const optional& x, const optional& y); +// template constexpr bool operator>= (const optional& x, const optional& y); #include diff --git a/libcxx/test/std/utilities/optional/optional.relops/greater_than.pass.cpp b/libcxx/test/std/utilities/optional/optional.relops/greater_than.pass.cpp index 3946a6102ba9..c3f2af9323ab 100644 --- a/libcxx/test/std/utilities/optional/optional.relops/greater_than.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.relops/greater_than.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator> (const optional& x, const optional& y); +// template constexpr bool operator> (const optional& x, const optional& y); #include diff --git a/libcxx/test/std/utilities/optional/optional.relops/less_equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.relops/less_equal.pass.cpp index 5a1954154f44..35e80d3d4e50 100644 --- a/libcxx/test/std/utilities/optional/optional.relops/less_equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.relops/less_equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator<= (const optional& x, const optional& y); +// template constexpr bool operator<= (const optional& x, const optional& y); #include diff --git a/libcxx/test/std/utilities/optional/optional.relops/less_than.pass.cpp b/libcxx/test/std/utilities/optional/optional.relops/less_than.pass.cpp index 35956e6f4a70..1dbffbd92352 100644 --- a/libcxx/test/std/utilities/optional/optional.relops/less_than.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.relops/less_than.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator< (const optional& x, const optional& y); +// template constexpr bool operator< (const optional& x, const optional& y); #include diff --git a/libcxx/test/std/utilities/optional/optional.relops/not_equal.pass.cpp b/libcxx/test/std/utilities/optional/optional.relops/not_equal.pass.cpp index 1256537d6a86..12d9922a9592 100644 --- a/libcxx/test/std/utilities/optional/optional.relops/not_equal.pass.cpp +++ b/libcxx/test/std/utilities/optional/optional.relops/not_equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// template constexpr bool operator!=(const optional& x, const optional& y); +// template constexpr bool operator!=(const optional& x, const optional& y); #include #include