Releases: zrax/string_theory
Releases · zrax/string_theory
String Theory 3.9
- CMake: Add namespaced library
string_theory::string_theoryfor better CMake target integration. The previous non-namespaced target is still available, but may be removed in string_theory 4.0. - CMake: Fix attempted multiple definition of
string_theorytarget when the package is found more than once. - Annotate functions with
[[lifetimebound]]attribute where applicable. - Update minimum CMake version to 3.14.
- Update GTest to 1.15.2 (NOTE: This means building the string_theory tests requires C++14 now)
- NOTE: GTest is now fetched with FetchContent rather than being included as a submodule.
String Theory 3.8
- Fix UB in
findand related operations, which could read past the end of the string in certain cases. - Fix
<cstdint>include inst_string.h - Fix some compiler warnings with newer versions of MSVC and GCC
String Theory 3.7
- Fix a clang optimization that would produce incorrect results for
ST::string::from_intin Release builds - Update GTest to 1.11 to fix issues with newer compilers
- NOTE: GTest is now included as a git submodule rather than directly in the source tree.
String Theory 3.6
- Fix
std::filesystemuse on MacOS to correctly detect availability based on the target platform's SDK version. - Fix
ST::string::to_buffer(char_buffer &)always returning Latin-1 data even when UTF-8 was requested. - Fix some warnings on GCC 11 and 12.
String Theory 3.5
- Add a
data()method toST::stringfor better STL compatibility/consistency. - Add overloads to
find(),find_last()andcontains()for when the (C-style) substring size is known. - Improve performance of some string APIs.
- Fix
ST::buffer<T>::compareand friends to work correctly with non-charbuffers. - Fix C++ feature detection to not return false negatives when building with
-Werror - Fix a build failure on GCC 11.
- Disallow
ST::string::view()on temporary (rvalue) objects. - Remove the redundant (and undocumented)
ST::string::from_literalconstructor method.
String Theory 3.4
- Fix
ST_WCHAR_LITERAL,ST_UTF16_LITERALandST_UTF32_LITERALmacros, which would previously create an incorrectly-sized buffer for non-empty strings. - Add
ST::buffer<T>::clear()andST::string::clear()methods - Deprecate
ST::nullandST::null_tin favor of better alternatives:- Construction: Use
{}or an explicit constructor (ST::string(),ST::char_buffer()) - Comparison: Use
.empty() - Assignment: Use
.clear()or assign a default-constructed object.
- Construction: Use
String Theory 3.3
- Add support for
}}as an escape sequence for literal}in format strings. This means that formatting a string with escaped literal{}characters can be balanced:ST::format("... {{some-uuid}} ...") => "... {some-uuid} ...".- Warning: This is a potentially backwards-incompatible change. If you already have format strings that contain a double
}}, they will need to be escaped now (}}}}). - Note: There is no behavior change for a single
}which is not already part of a format specifier. It will still be written as-is to the output, for backwards compatibility.
- Warning: This is a potentially backwards-incompatible change. If you already have format strings that contain a double
- Remove support for
std::experimental::string_viewandstd::experimental::filesystemin favor of the non-experimental versions. - Fix a unit test for compatibility with musl libc.
- Clean up a few unnecessary includes and no-longer used internal support macros.
- Fix a few minor issues identified by cppcheck.
- GCC: Only link to
stdc++fswhen it is required for usingstd::filesystem.
String Theory 3.2
- Fix
std::filesystem::pathsupport in MSVC 2019 when using C++17 instead of C++20. - Add more basic conversions (to/from short, long, long long) and deprecate to/from explicit int64 types.
- Remove some unused config macros.
String Theory 3.1
Bug fix release:
- Fix attribute detection so
[[nodiscard]]is only used on compilers that support it without a warning. - Fix unit tests to not emit warnings on
[[nodiscard]]functions. - Restore
ST::string_stream::operator<<(char)and instead disable thesigned charandunsigned charoverloads, to help catch places whereint8_tanduint8_tmight be aliased to something unexpected. 8-bit integers can be streamed by first casting them to the appropriate int type (intorunsigned int).
String Theory 3.0
Major Changes
- String Theory 3.0 is now a header-only library. You still need CMake for configuring st_config.h and building the tests, but after installing it, only the include directory is necessary.
- Note: For CMake projects, no change is necessary to use 3.0. The provided library is converted to an INTERFACE library which includes the required include directory and removes any linked libs.
- String Theory 3.0 now requires C++11 at minimum. If you still need support for pre-C++11 compilers, you will need to stay on 2.x.
- Many parts of String Theory which previously called
ST_ASSERTfor interface violations have been updated to throw exceptions instead.ST_ASSERTis now reserved only for unrecoverable failures in the library are not due to misuse of the API. - Breaking: The default format of individual characters in
ST::formatand friends is changed to their equivalent integral types, in order to avoid type aliasing issues in some environments. In order to remain compatible with both 2.x and 3.0, callers should use the"{c}"format specifier to explicitly request character formatting.
Changes, Additions, Fixes
- Moved user-defined literals to the
ST::literalsnamespace to avoid namespace collisions. When porting, you can useusing namespace ST::literals;to re-enable their use. - Added an
_stfmtuser-defined literal which can be used for literal format strings. For example:
"The {} is {}"_stfmt("answer", 42); - De-obfuscated the mechanism for declaring custom formatters. The old macros will still work, but new code should declare a
format_typeoverload directly now. See Defining Custom Formatters for details. - Conversion between all supported encodings (UTF-8, UTF-16, UTF-32, Latin-1 and
wchar_t) is now available outside of theST::stringclass, including between encodings which previously did not have any direct conversion available. See the wiki for details. - Support basic (case-sensitive) comparison on
ST::buffer<T>objects withcompare()andoperator<(). - Fix UTF-8 conversions to not skip invalid sequence bytes when converting with substitutes. This behavior matches other UTF-8 implementations, including Python and Qt5.
- Add more support for STL string classes in
ST::formatandST::string_stream(Thanks @Hoikas) - Several performance improvements.
- Several unit testing improvements in both coverage and functionality.
Removed Features
- APIs marked deprecated in 2.0 are now removed.
ST::set_assert_handlerandST::set_default_assert_handlerwere removed sinceST_ASSERTis no longer used for interface violations.ST::utf_validation_t::assert_validityis removed since it no longer makes any sense.- Removed implicit conversions to
std::string_view.