diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-11-04 11:11:58 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-11-04 18:14:50 +0000 |
commit | b57899f30f4325a6fe4c791cf01a6a8c94b4ae50 (patch) | |
tree | 06adad1edae89f6727b2dec5fcaaac7d05ab80ab /gcc | |
parent | 09aab7e699dcbd79fd64959cf259567bdca94022 (diff) | |
download | gcc-b57899f30f4325a6fe4c791cf01a6a8c94b4ae50.zip gcc-b57899f30f4325a6fe4c791cf01a6a8c94b4ae50.tar.gz gcc-b57899f30f4325a6fe4c791cf01a6a8c94b4ae50.tar.bz2 |
libstdc++: Consolidate duplicate metaprogramming utilities
Currently std::variant uses __index_of<T, Types...> to find the first
occurence of a type in a pack, and __exactly_once<T, Types...> to check
that there is no other occurrence.
We can reuse the __find_uniq_type_in_pack<T, Types...>() function for
both tasks, and remove the recursive templates used to implement
__index_of and __exactly_once.
libstdc++-v3/ChangeLog:
* include/bits/utility.h (__find_uniq_type_in_pack): Move
definition to here, ...
* include/std/tuple (__find_uniq_type_in_pack): ... from here.
* include/std/variant (__detail__variant::__index_of): Remove.
(__detail::__variant::__exactly_once): Define using
__find_uniq_type_in_pack instead of __index_of.
(get<T>, get_if<T>, variant::__index_of): Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions