]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/60710 (experimental::optional<T> is using T::operator!=)
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 25 Apr 2014 19:34:42 +0000 (19:34 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 25 Apr 2014 19:34:42 +0000 (20:34 +0100)
2014-04-25  Lars Gullik Bjønnes  <larsbj@gullik.org>

PR libstdc++/60710
* include/experimental/optional (operator!=): Implement in terms of
operator==.
* testsuite/experimental/optional/relops/1.cc: Remove operator!=.
* testsuite/experimental/optional/relops/2.cc: Likewise.
* testsuite/experimental/optional/relops/3.cc: Likewise.
* testsuite/experimental/optional/relops/4.cc: Likewise.
* testsuite/experimental/optional/relops/5.cc: Likewise.
* testsuite/experimental/optional/relops/6.cc: Likewise.

From-SVN: r209810

libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/optional
libstdc++-v3/testsuite/experimental/optional/relops/1.cc
libstdc++-v3/testsuite/experimental/optional/relops/2.cc
libstdc++-v3/testsuite/experimental/optional/relops/3.cc
libstdc++-v3/testsuite/experimental/optional/relops/4.cc
libstdc++-v3/testsuite/experimental/optional/relops/5.cc
libstdc++-v3/testsuite/experimental/optional/relops/6.cc

index eace534a30b7a563fe1aaf7427fee4ee50dbf63f..2a2c0686195618ce1e2d1813c4d6930ddd991fb7 100644 (file)
@@ -1,3 +1,15 @@
+2014-04-25  Lars Gullik Bjønnes  <larsbj@gullik.org>
+
+       PR libstdc++/60710
+       * include/experimental/optional (operator!=): Implement in terms of
+       operator==.
+       * testsuite/experimental/optional/relops/1.cc: Remove operator!=.
+       * testsuite/experimental/optional/relops/2.cc: Likewise.
+       * testsuite/experimental/optional/relops/3.cc: Likewise.
+       * testsuite/experimental/optional/relops/4.cc: Likewise.
+       * testsuite/experimental/optional/relops/5.cc: Likewise.
+       * testsuite/experimental/optional/relops/6.cc: Likewise.
+
 2014-04-25  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/60958
index 5f2d93fb7f6df06e3d070008089cab4b6b48b9a1..2a3f29dcd70f35ce570da2f31cc30a8f3ac3ac72 100644 (file)
@@ -736,12 +736,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp>
     constexpr bool
     operator!=(const optional<_Tp>& __lhs, _Tp const& __rhs)
-    { return !__lhs || *__lhs != __rhs; }
+    { return !__lhs || !(*__lhs == __rhs); }
 
   template<typename _Tp>
     constexpr bool
     operator!=(const _Tp& __lhs, const optional<_Tp>& __rhs)
-    { return !__rhs || __lhs != *__rhs; }
+    { return !__rhs || !(__lhs == *__rhs); }
 
   template<typename _Tp>
     constexpr bool
index f1408805ac2d9a2e0731299dadb1a466e21a2d6c..3f1ee9c4900fa82e52d1850482f791a15a5ea1c1 100644 (file)
@@ -36,10 +36,6 @@ namespace ns
   operator==(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
 
-  bool
-  operator!=(value_type const& lhs, value_type const& rhs)
-  { return !(lhs == rhs); }
-
   bool
   operator<(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
index c7fc848deb06474d08ee3c902e1c7837f07c77a9..6ee9cba768a403d757f26a84048a3da326dc7188 100644 (file)
@@ -36,10 +36,6 @@ namespace ns
   operator==(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
 
-  bool
-  operator!=(value_type const& lhs, value_type const& rhs)
-  { return !(lhs == rhs); }
-
   bool
   operator<(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
index 9729000d5ca1a73f08b1d5ba08cb2b11685ab1f2..581d0168fbca1e19711a5a98629c1fedca43231c 100644 (file)
@@ -36,10 +36,6 @@ namespace ns
   operator==(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
 
-  bool
-  operator!=(value_type const& lhs, value_type const& rhs)
-  { return !(lhs == rhs); }
-
   bool
   operator<(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
index 45378f688e400bd80da98a643385bf9e50b3f6dd..ce16fcb92f5dfc3ffa8fbf6e1ea45eadc7a338d8 100644 (file)
@@ -36,10 +36,6 @@ namespace ns
   operator==(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
 
-  bool
-  operator!=(value_type const& lhs, value_type const& rhs)
-  { return !(lhs == rhs); }
-
   bool
   operator<(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
index 008409ef402921b890b124d21695975a6f97cf96..c01bba57a5e8e129443274c3bf6b2bada0f8260f 100644 (file)
@@ -36,10 +36,6 @@ namespace ns
   operator==(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
 
-  bool
-  operator!=(value_type const& lhs, value_type const& rhs)
-  { return !(lhs == rhs); }
-
   bool
   operator<(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
index b17914062ee47effa2a3415b2db40e7a6438b0fd..a24622b5f4078d2b5df1ec965439cae63c1e2b15 100644 (file)
@@ -36,10 +36,6 @@ namespace ns
   operator==(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
 
-  bool
-  operator!=(value_type const& lhs, value_type const& rhs)
-  { return !(lhs == rhs); }
-
   bool
   operator<(value_type const& lhs, value_type const& rhs)
   { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }