]> git.ipfire.org Git - thirdparty/gcc.git/commit
Implement sane variant converting constructor (P0608R3)
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 May 2019 20:30:35 +0000 (20:30 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 May 2019 20:30:35 +0000 (20:30 +0000)
commita8a0d1649676a45e338e46071c2d0565b6168327
tree7ff15df0c3b8141371e384465d6b7d8ea68ce04f
parentfacad3f4e8aea3036336cf3ecb041497b093b139
Implement sane variant converting constructor (P0608R3)

* include/std/variant (__overload_set): Remove.
(_Arr): New helper.
(_Build_FUN): New class template to define a single FUN overload,
with specializations to prevent unwanted conversions, as per P0608R3.
(_Build_FUNs): New class template to build an overload set of FUN.
(_FUN_type): New alias template to perform overload resolution.
(__accepted_type): Use integer_constant base for failure case. Use
_FUN_type for successful case.
(variant::__accepted_index): Use _Tp instead of _Tp&&.
(variant::variant(_Tp&&)): Likewise.
(variant::operator=(_Tp&&)): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271296 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/variant/compile.cc
libstdc++-v3/testsuite/20_util/variant/run.cc