Implement P0307R2, Making Optional Greater Equal Again.
commit2cf314059b52c0646f4e25cfb0e73e9b8907b8f3
authorville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Jul 2016 11:25:51 +0000 (13 11:25 +0000)
committerville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Jul 2016 11:25:51 +0000 (13 11:25 +0000)
tree183e726ed4834c25799cc810c4c8924243be982d
parent4300aa2087d90cd2d55852fa38f082a89bc7e72d
Implement P0307R2, Making Optional Greater Equal Again.
* include/experimental/optional (_Has_addressof): Fix the comment.
* include/std/optional (_Has_addressof): Likewise.
(operator=(_Up&&)): Constrain.
(operator=(const optional<_Up>&)): Likewise.
(operator=(optional<_Up>&&)): Likewise.
(__optional_relop_t): New.
(operator==(const optional<_Tp>&, const optional<_Tp>&)): Constrain.
(operator!=(const optional<_Tp>&, const optional<_Tp>&)):
Constrain and make transparent.
(operator<(const optional<_Tp>&, const optional<_Tp>&)): Constrain.
(operator>(const optional<_Tp>&, const optional<_Tp>&)):
Constrain and make transparent.
(operator<=(const optional<_Tp>&, const optional<_Tp>&)): Likewise.
(operator>=(const optional<_Tp>&, const optional<_Tp>&)): Likewise.
(operator==(const optional<_Tp>&, const _Tp&): Constrain.
(operator==(const _Tp&, const optional<_Tp>&)): Likewise.
(operator!=(const optional<_Tp>&, _Tp const&)):
Constrain and make transparent.
(operator!=(const _Tp&, const optional<_Tp>&)): Likewise.
(operator<(const optional<_Tp>&, const _Tp&)): Constrain.
(operator<(const _Tp&, const optional<_Tp>&)): Likewise.
(operator>(const optional<_Tp>&, const _Tp&)):
Constrain and make transparent.
(operator>(const _Tp&, const optional<_Tp>&)): Likewise.
(operator<=(const optional<_Tp>&, const _Tp&)): Likewise.
(operator<=(const _Tp&, const optional<_Tp>&)): Likewise.
(operator>=(const optional<_Tp>&, const _Tp&)): Likewise.
(operator>=(const _Tp&, const optional<_Tp>&)): Likewise.
* testsuite/20_util/optional/constexpr/relops/2.cc: Adjust.
* testsuite/20_util/optional/constexpr/relops/4.cc: Likewise.
* testsuite/20_util/optional/relops/1.cc: Likewise.
* testsuite/20_util/optional/relops/2.cc: Likewise.
* testsuite/20_util/optional/relops/3.cc: Likewise.
* testsuite/20_util/optional/relops/4.cc: Likewise.
* testsuite/20_util/optional/requirements.cc: Add tests to verify
that optional's relops are transparent and don't synthesize
operators. Also test that assignment sfinaes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238292 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/optional
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/optional/constexpr/relops/2.cc
libstdc++-v3/testsuite/20_util/optional/constexpr/relops/4.cc
libstdc++-v3/testsuite/20_util/optional/relops/1.cc
libstdc++-v3/testsuite/20_util/optional/relops/2.cc
libstdc++-v3/testsuite/20_util/optional/relops/3.cc
libstdc++-v3/testsuite/20_util/optional/relops/4.cc
libstdc++-v3/testsuite/20_util/optional/requirements.cc