UgMisc

A miscellaneous header-only C++ library, compatible with C++17 and later standards.

Even though the headers work with C++17, they will use C++20 concepts if they are available, so that compiler error messages will be clearer.

The repository is currently hosted at codeberg.org.

Overview

Utilities provided include:

#include <ugmisc/member>

UGMISC_DECL_MEMBER_ACCESS(Foo, foo); // Declares Foo.
// Foo is a type that searches for members named "foo".
using F = ugmisc::static_member_caller<Foo, X, Y, Z>;

F::call(args...); // Error if none of X, Y, Z has a static method called "foo" that can be called this way.

// Instances of F are callable.
F f;
f.call(args...); // Same as F::call(args...).
f(args...); // Same as F::call(args...).

// Default value:
// The following two expressions are equivalent.
F::fallback( func )(args...);
f.fallback( func )(args...);

In the fallback example above, the first valid expression is evaluated:

Documentation

Files

For tagged releases, the source is available in tar.xz and zip archives, along with a Meson wrap file. There is a file containing digests of these files, and the digests file is signed using the same OpenPGP key used to sign commits in the repository.

The files are hosted at Codeberg.