mirror of
https://github.com/boostorg/static_string.git
synced 2026-08-26 14:46:37 +02:00
62ed5ee17a72dd4e021bda1017822dd9f41b4224
compare(const CharT* s) constructed a temporary basic_static_cstring<N>
from s and delegated to the class-type overload. The constructor throws
std::length_error when traits::length(s) > N, and because compare() is
noexcept, the throw led to std::terminate():
static_cstring<3> s("abc");
s.compare("abcd"); // terminate() via noexcept throw
The free operator==() / operator!=() overloads for const CharT*, which
delegate to compare(), had the same flaw.
Boost.StaticString
| Branch | GHA CI | Appveyor | Azure Pipelines | codecov.io | Docs | Matrix |
|---|---|---|---|---|---|---|
master |
||||||
develop |
Introduction
This library provides a dynamically resizable string of characters with
compile-time fixed capacity and contiguous embedded storage in which the
characters are placed within the string object itself. Its API closely
resembles that of std::string.
License
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
Languages
C++
98.5%
CMake
0.9%
Shell
0.5%
HTML
0.1%