Commit e2ce9436 by Lars Gullik Bjønnes Committed by Jonathan Wakely

re PR libstdc++/60710 (experimental::optional<T> is using T::operator!=)

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
parent 10432733
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> 2014-04-25 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60958 PR libstdc++/60958
......
...@@ -736,12 +736,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -736,12 +736,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp> template<typename _Tp>
constexpr bool constexpr bool
operator!=(const optional<_Tp>& __lhs, _Tp const& __rhs) operator!=(const optional<_Tp>& __lhs, _Tp const& __rhs)
{ return !__lhs || *__lhs != __rhs; } { return !__lhs || !(*__lhs == __rhs); }
template<typename _Tp> template<typename _Tp>
constexpr bool constexpr bool
operator!=(const _Tp& __lhs, const optional<_Tp>& __rhs) operator!=(const _Tp& __lhs, const optional<_Tp>& __rhs)
{ return !__rhs || __lhs != *__rhs; } { return !__rhs || !(__lhs == *__rhs); }
template<typename _Tp> template<typename _Tp>
constexpr bool constexpr bool
......
...@@ -37,10 +37,6 @@ namespace ns ...@@ -37,10 +37,6 @@ namespace ns
{ return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
bool bool
operator!=(value_type const& lhs, value_type const& rhs)
{ return !(lhs == rhs); }
bool
operator<(value_type const& lhs, value_type const& rhs) operator<(value_type const& lhs, value_type const& rhs)
{ return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
......
...@@ -37,10 +37,6 @@ namespace ns ...@@ -37,10 +37,6 @@ namespace ns
{ return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
bool bool
operator!=(value_type const& lhs, value_type const& rhs)
{ return !(lhs == rhs); }
bool
operator<(value_type const& lhs, value_type const& rhs) operator<(value_type const& lhs, value_type const& rhs)
{ return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
......
...@@ -37,10 +37,6 @@ namespace ns ...@@ -37,10 +37,6 @@ namespace ns
{ return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
bool bool
operator!=(value_type const& lhs, value_type const& rhs)
{ return !(lhs == rhs); }
bool
operator<(value_type const& lhs, value_type const& rhs) operator<(value_type const& lhs, value_type const& rhs)
{ return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
......
...@@ -37,10 +37,6 @@ namespace ns ...@@ -37,10 +37,6 @@ namespace ns
{ return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
bool bool
operator!=(value_type const& lhs, value_type const& rhs)
{ return !(lhs == rhs); }
bool
operator<(value_type const& lhs, value_type const& rhs) operator<(value_type const& lhs, value_type const& rhs)
{ return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
......
...@@ -37,10 +37,6 @@ namespace ns ...@@ -37,10 +37,6 @@ namespace ns
{ return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
bool bool
operator!=(value_type const& lhs, value_type const& rhs)
{ return !(lhs == rhs); }
bool
operator<(value_type const& lhs, value_type const& rhs) operator<(value_type const& lhs, value_type const& rhs)
{ return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
......
...@@ -37,10 +37,6 @@ namespace ns ...@@ -37,10 +37,6 @@ namespace ns
{ return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) == std::tie(rhs.i, rhs.s); }
bool bool
operator!=(value_type const& lhs, value_type const& rhs)
{ return !(lhs == rhs); }
bool
operator<(value_type const& lhs, value_type const& rhs) operator<(value_type const& lhs, value_type const& rhs)
{ return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); } { return std::tie(lhs.i, lhs.s) < std::tie(rhs.i, rhs.s); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment