cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
"Implementation Fixes"

Fixes to features in std

Some features in namespace std are implemented with issues or in unusable fashion in some compilers, and as such cxxomfort can not reuse the names to provide fixed versions.

To deal with this, namespace cxxomfort::fix offers a number of alternatives or "forwarders" for the features in namespace std. These names either redirect to the std one if it's working, or to an implementation in cxxomfort when they are not.

Examples of features here:

For a more comprehensive listing of fixes, check the various headers' notes on "<b>Interfaces not in std</b>".

Some of the fixes are detailed below:


Nonmember helpers for string types

The basic_string interface is a mess (over 100 member functions). Also, the fact that the operations are defined as members means cxxomfort (nor any other library) can't extend or backport members added a posteriori, such as what's done in C++20.

cxxomfort gets around this by defining a number of nonmember accessors for the members in basic_string and basic_string_view, analogue to what <iterator> does in C++17 for containers general. This has the advantage that such interface is extensible.

The accessors are provided in namespace cxxomfort::string and include but are not limited to:

Fixes to <tt>std::errc</tt>


Member cxxomfort::fix::to_byte (Integral i) noexcept
Create byte values.
Member cxxomfort::fix::to_value (std::integral_constant< Ty, u > const) CXXO_NOEXCEPTNOTHROW
Value corresponding to a integral_constant.
Member cxxomfort::make_cxxo_array (T &&... t)
Creates an array (part of experimental/lfv2)
Member cxxomfort::string::c_str (std::basic_string< Ch, ChT, A > const &str) CXXO_NOEXCEPT
Nonmember string helpers
Member cxxomfort::string::clear (std::basic_string< Ch, ChT, A > &str) CXXO_NOEXCEPT
Nonmember string helpers
Member cxxomfort::string::compare (std::basic_string_view< Ch, ChT > const str1, R const &str2)
Nonmember string helpers
Member cxxomfort::string::compare (std::basic_string_view< Ch, ChT > const str1, size_t pos, size_t count, std::basic_string_view< Ch, ChT > const str2) CXXO_NOEXCEPT
Nonmember string helpers
Member cxxomfort::string::compare (std::basic_string_view< Ch, ChT > const str1, std::basic_string_view< Ch, ChT > const str2) CXXO_NOEXCEPT
Nonmember string helpers std0string_view "" "" nonmember string helpers
Class integral_limits< T >
Compile-time constants for integral limits