Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 1, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

fix #31, fix #20
@pull pull bot added the ⤵️ pull label Nov 1, 2022
gennaroprota and others added 30 commits October 22, 2025 19:06
C++26 specifies that std::to_string() and std::to_wstring() format
floating point values as if using std::format(). This commit updates the
internal conversion helpers to match that behavior, using
std::format_to_n() for efficient, allocation-free formatting directly
into the static_string/static_wstring buffer.

Fallbacks using snprintf()/swprintf() remain active for pre-C++26
builds.

This ensures consistent formatting across standard and Boost APIs.
The config.hpp uses `BOOST_LIBSTDCXX_VERSION` which isn't defined in
standalone mode so `BOOST_STATIC_STRING_NO_CXX17_HDR_STRING_VIEW` will
be defined.
This then causes build failures for code expecting the availability of
string_view.
`source_group(TREE` requires CMake 3.8
… C-style string in a constexpr context

This triggers a libstdc++ issue which was fixed in GCC 12.4 and 13.3:
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113200>. If our CI shows
we bump into that bug, we'll add a workaround.
See the previous commit. This simple fix avoids calling Traits::move(),
which is where the bug resides.

This closes issue #55.
GCC 5-10 incorrectly complain about our nested classes being private.
So, make them public.
They were conditioned on detection of C++20 via __cplusplus, but Clang
10 and 11 don't support class types as NTTP, even though they report
C++20 via __cplusplus when -std=c++20 is used.
The iterator-based insert(const_iterator, size_type, value_type)
function relies on traits_type::move() to shift the existing null
terminator to its new position. Clang 3.7's constexpr evaluator does not
handle this correctly, causing the following test to fail:

  static_string<3>{"ab"}.insert(2, 1, 'c') == "abc"

Add an explicit term() call, guarded by a preprocessor conditional for
Clang 3.7, to ensure proper null termination.
This introduces an alternative to basic_static_string designed for use
in POD types: Trivially copyable, having a sizeof == N + 1, with no
embedded NULs.

Placed in example/ to gather user feedback before committing to a public
API. See issue #23.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants