aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2024-12-20 12:09:10 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2025-01-08 12:45:38 +0000
commit5db068738469be8c2bf3cfbda4c54725bd9fe228 (patch)
treef65453eaf6ddcf859ea8aa05a1f54d59bfc2c6cf /gcc
parentcbef2c1dbd0a609f68862c0a9aa9bf80a502411e (diff)
downloadgcc-5db068738469be8c2bf3cfbda4c54725bd9fe228.zip
gcc-5db068738469be8c2bf3cfbda4c54725bd9fe228.tar.gz
gcc-5db068738469be8c2bf3cfbda4c54725bd9fe228.tar.bz2
libstdc++: add initializer_list constructor to std::span (P2447R6)
This commit implements P2447R6. The code is straightforward (just one extra constructor, with constraints and conditional explicit). I decided to suppress -Winit-list-lifetime because otherwise it would give too many false positives. The new constructor is meant to be used as a parameter-passing interface (this is a design choice, see P2447R6/ยง2) and, as such, the initializer_list won't dangle despite GCC's warnings. The new constructor isn't 100% backwards compatible. A couple of examples are included in Annex C, but I have also lifted some more from R4. A new test checks for the old and the new behaviors. libstdc++-v3/ChangeLog: * include/bits/version.def: Add the new feature-testing macro. * include/bits/version.h: Regenerate. * include/std/span: Add constructor from initializer_list. * testsuite/23_containers/span/init_list_cons.cc: New test. * testsuite/23_containers/span/init_list_cons_neg.cc: New test. Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions