]> gcc.gnu.org Git - gcc.git/commit - libstdc++-v3/ChangeLog
libstdc++: Make byte-sized std::fill_n a constant expression (PR 94933)
authorJonathan Wakely <jwakely@redhat.com>
Sun, 3 May 2020 11:46:15 +0000 (12:46 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sun, 3 May 2020 12:33:15 +0000 (13:33 +0100)
commit22b6b5d6cfb76deb68ca5bc0bcae8b4245df946d
tree57cdb833b8970bc3301816c9862d9b748b0e5c21
parent18a6e4130fb3c63a974295a18ed6e4bef070df03
libstdc++: Make byte-sized std::fill_n a constant expression (PR 94933)

The overload for byte types uses memset and isn't constexpr. This adds
the specifier and uses std::is_constant_evaluated() to provide a
compile-time alternative.

PR libstdc++/94933
* include/bits/stl_algobase.h (__fill_a1): Make overload for byte types
usable in constant expressions.
* testsuite/25_algorithms/fill_n/constexpr.cc: Test with bytes and
non-scalars.
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/testsuite/25_algorithms/fill_n/constexpr.cc
This page took 0.060329 seconds and 5 git commands to generate.