stl_algobase.h
70.2 KB
-
libstdc++: Make byte-sized std::fill_n a constant expression (PR 94933) · 8836c35d
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. Backport from mainline 2020-05-03 Jonathan Wakely <jwakely@redhat.com> 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.
Jonathan Wakely committed