scl-utility

ScL.Utility

GitLab Pipeline GitLab Pages GitHub Pages

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.

Features

Requirements

Installation

Add the module as a subdirectory and link against the interface target:

add_subdirectory(module/utility)
target_link_libraries(your_target PRIVATE scl::utility)

Quick example

#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"
}

Doxygen

Documentation

See also