Common C++20 utilities not available in the standard library.
ScL.Utility is a header-only module of the ScL Toolkit providing compile-time meta-programming helpers, preprocessor utilities, and extended type traits. Licensed under The Unlicense.
type_name<T> / type_short_name<T> — human-readable type namesenum_name<V> / enum_short_name<V> — enum member namessymbol_name<S> / symbol_short_name<S> — function and data member namesSCL_FORWARD — identity macro for token forwarding in macro chainsSCL_COUNTER_VALUE / SCL_COUNTER_NEXT — compile-time counter via ADLis_detected, detected_t, detected_or)forward_like — forward with value category of another typemember_like — member pointer trait decompositionoverload_cast<Args...> — overloaded function pointer disambiguationAdd the module as a subdirectory and link against the interface target:
add_subdirectory(module/utility)
target_link_libraries(your_target PRIVATE scl::utility)
#include <scl/utility/meta/type.h>
#include <scl/utility/meta/enum.h>
#include <iostream>
enum class Color { Red, Green, Blue };
int main() {
// Compile-time type name
constexpr auto name = scl::type_name<std::vector<int>>();
std::cout << name << std::endl;
// Compile-time enum member name
constexpr auto color = scl::enum_name<Color::Red>();
std::cout << color << std::endl; // "Color::Red"
}