Reduce the size of variant, it doesn't need an index of
commitcfdb4aba139db94e78d4fd2a7afd44634bff3201
authorville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jan 2017 11:23:43 +0000 (11 11:23 +0000)
committerville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jan 2017 11:23:43 +0000 (11 11:23 +0000)
tree8e92072dbc8ee05ff40976301839998c89081a90
parent86814365f6a4e5972c9014c1ad95187e8d7e6b87
Reduce the size of variant, it doesn't need an index of
type size_t internally.
* include/std/variant (parse_numbers.h): New include.
(__select_index): New.
(_Variant_storage<false, _Types...>::_M_reset_impl): Use
_index_type for comparison with variant_npos.
(_Variant_storage<false, _Types...>::__index_type): New.
(_Variant_storage<false, _Types...>::_M_index): Change the
type from size_t to __index_type.
(_Variant_storage<true, _Types...>::__index_type): New.
(_Variant_storage<true, _Types...>::_M_index): Change the
type from size_t to __index_type.
(_Variant_base::_M_valid): Use _Storage::__index_type
for comparison with variant_npos.
(variant::index): Use _Base::_Storage::__index_type
for comparison with variant_npos.
* testsuite/20_util/variant/index_type.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244309 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/variant/index_type.cc [new file with mode: 0644]