cxxomfort
rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
Cxxomfort independent utilities
cxxomfort
ships with a few independent utilities not dependent on features of specific C++ Standards. These are accessed by directly including the header:
The header is not intended to be directly included, but can be done so nonetheless. Still, including most of the backport header files guarantees its inclusion.
All features here are directly under the cxxomfort
namespace (unless they are eg.: macros).
The following is an incomplete listing of features available under this namespace:
Generalistic Tools
rvoid
- regular void
based on early p0146
None
- generalised "None" type and keywordnoop_fn
, noop()
noop generalised functioncxxomfort::bool_once()
- checks and unsets a bool
variable in one stepcxxomfort::outp
- output parameter wrappercxxomfort::prio<N>
- priority tagCode Generation
CXXO_GENERATE_RELATIONALS
, CXXO_GENERATE_RELATIONALS2
- generate non.member relational operators given existing operator==
and/or operator<
.Utilities
constexpr_tag
- a tag type similar to std::nothrow
, to select constexpr function overloadscxxomfort::function_caller
- wrap a C function as their own type.coalesce()
- coalesces a sequence of pointer-like objects.coalesce_ptrs()
- return the first element in a collection of possibly-NULL pointers.cxxomfort::array_ref
- views over sequences of data.cxxomfort::basic_cstring_view
and derived like cstring_view
- views over native C strings.cxxomfort::st_math
- compile-time operations on integers, pre-C++11.std::array
array_ref
- a non-owning view to sequences of contiguous data true
once. constexpr
version of std::max()
constexpr
version of std::min()