mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-19 00:55:13 +08:00
30ab6d9e43
By defining additional partial specializations of _Nth_type we can reduce the number of recursive instantiations needed to get from N to 0. We can also use _Nth_type in variant_alternative, to take advantage of that new optimization. By adding a static_assert to variant_alternative we get a nicer error than 'invalid use of incomplete type'. By defining partial specializations of std::variant_size_v for the common case we can avoid instantiating the std::variant_size class template. The __tuple_count class template and __tuple_count_v variable template can be simplified to a single variable template, __count. By adding a deleted constructor to the _Variant_union primary template we can (very slightly) improve diagnostics for invalid attempts to construct a std::variant with an out-of-range index. Instead of a confusing error about "too many initializers for ..." we get a call to a deleted function. By using _Nth_type instead of variant_alternative (for cv-unqualified variant types) we avoid instantiating variant_alternative. By adding deleted overloads of variant::emplace we get better diagnostics for emplace<invalid-index> or emplace<invalid-type>. Instead of getting errors explaining why each of the four overloads wasn't valid, we just get one error about calling a deleted function. libstdc++-v3/ChangeLog: * include/std/variant (_Nth_type): Define partial specializations to reduce number of instantiations. (variant_size_v): Define partial specializations to avoid instantiations. (variant_alternative): Use _Nth_type. Add static assert. (__tuple_count, __tuple_count_v): Replace with ... (__count): New variable template. (_Variant_union): Add deleted constructor. (variant::__to_type): Use _Nth_type. (variant::emplace): Use _Nth_type. Add deleted overloads for invalid types and indices. |
||
---|---|---|
.. | ||
config | ||
doc | ||
include | ||
libsupc++ | ||
po | ||
python | ||
scripts | ||
src | ||
testsuite | ||
acinclude.m4 | ||
aclocal.m4 | ||
ChangeLog | ||
ChangeLog-1998 | ||
ChangeLog-1999 | ||
ChangeLog-2000 | ||
ChangeLog-2001 | ||
ChangeLog-2002 | ||
ChangeLog-2003 | ||
ChangeLog-2004 | ||
ChangeLog-2005 | ||
ChangeLog-2006 | ||
ChangeLog-2007 | ||
ChangeLog-2008 | ||
ChangeLog-2009 | ||
ChangeLog-2010 | ||
ChangeLog-2011 | ||
ChangeLog-2012 | ||
ChangeLog-2013 | ||
ChangeLog-2014 | ||
ChangeLog-2015 | ||
ChangeLog-2016 | ||
ChangeLog-2017 | ||
ChangeLog-2018 | ||
ChangeLog-2019 | ||
ChangeLog-2020 | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.host | ||
crossconfig.m4 | ||
fragment.am | ||
linkage.m4 | ||
Makefile.am | ||
Makefile.in | ||
README |
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.