37edf28c24
For a span with statically empty extent, we currently model the preconditions of front(), back(), and operator[] as if they are mandates, by using a static_assert to verify that extent != 0. This causes us to reject valid programs that would instantiate these member functions and at runtime never call them. Since they are already followed by more general runtime asserts, this patch just removes these static_asserts altogether, libstdc++-v3/ChangeLog: * include/std/span (span::front): Remove static_assert. (span::back): Likewise. (span::operator[]): Likewise. * testsuite/23_containers/span/back_neg.cc: Rewrite to verify that we check the preconditions of back() only when it's called. * testsuite/23_containers/span/front_neg.cc: Likewise for front(). * testsuite/23_containers/span/index_op_neg.cc: Likewise for operator[]. |
||
---|---|---|
.. | ||
17_intro | ||
18_support | ||
19_diagnostics | ||
20_util | ||
21_strings | ||
22_locale | ||
23_containers | ||
24_iterators | ||
25_algorithms | ||
26_numerics | ||
27_io | ||
28_regex | ||
29_atomics | ||
30_threads | ||
abi | ||
backward | ||
config | ||
data | ||
decimal | ||
experimental | ||
ext | ||
lib | ||
libstdc++-abi | ||
libstdc++-dg | ||
libstdc++-prettyprinters | ||
libstdc++-xmethods | ||
performance | ||
special_functions | ||
std | ||
tr1 | ||
tr2 | ||
util | ||
Makefile.am | ||
Makefile.in |