diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-09-15 21:40:20 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-09-16 22:59:47 +0100 |
commit | 9d813ddd978aff75001d53fe55ff15e9167bb4d0 (patch) | |
tree | 94e6128801543a537a63b461b0a4056336a9ede7 /gcc | |
parent | 869107c9c9752c9a53cdb06179c1e6be6d2e5f44 (diff) | |
download | gcc-9d813ddd978aff75001d53fe55ff15e9167bb4d0.zip gcc-9d813ddd978aff75001d53fe55ff15e9167bb4d0.tar.gz gcc-9d813ddd978aff75001d53fe55ff15e9167bb4d0.tar.bz2 |
libstdc++: Add noexcept to std::to_string overloads that don't allocate
When the values is guaranteed to fit in the SSO buffer we know the
string won't allocate, so the function can be noexcept. For 32-bit
integers, we know they need no more than 9 bytes (or 10 with a minus
sign) and the SSO buffer is 15 bytes.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
(to_string): Add noexcept if the type width is 32 bits or less.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions