{"id":22211991,"url":"https://github.com/guillaumedua/cppshelf","last_synced_at":"2025-07-27T11:32:46.547Z","repository":{"id":37248157,"uuid":"376932220","full_name":"GuillaumeDua/CppShelf","owner":"GuillaumeDua","description":"Collection of powerfuls - C++ Single-Header Libraries Files","archived":false,"fork":false,"pushed_at":"2024-10-29T20:36:48.000Z","size":10342,"stargazers_count":9,"open_issues_count":160,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T22:50:02.153Z","etag":null,"topics":["cpp","cpp20","metaprogramming"],"latest_commit_sha":null,"homepage":"https://guillaumedua.github.io/CppShelf/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GuillaumeDua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-14T19:19:29.000Z","updated_at":"2024-09-10T20:06:21.000Z","dependencies_parsed_at":"2023-12-15T18:48:17.836Z","dependency_job_id":"9a76d959-08ea-4ee5-9fbc-75c26011ea4d","html_url":"https://github.com/GuillaumeDua/CppShelf","commit_stats":null,"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuillaumeDua%2FCppShelf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuillaumeDua%2FCppShelf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuillaumeDua%2FCppShelf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuillaumeDua%2FCppShelf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuillaumeDua","download_url":"https://codeload.github.com/GuillaumeDua/CppShelf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227802141,"owners_count":17822098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp20","metaprogramming"],"created_at":"2024-12-02T20:46:21.588Z","updated_at":"2024-12-02T20:46:22.207Z","avatar_url":"https://github.com/GuillaumeDua.png","language":"C++","readme":"# C++ Shelf\n\n\u003cimg src=\"https://github.com/GuillaumeDua/CppShelf/blob/main/docs/details/images/Shelf_icons_created_by_juicy_fish_Flaticon.png?raw=true\" alt=\"\" align=\"left\" height=\"150\" style=\"Padding: 0px 10px 0px 0px\"/\u003e\n\n\u003cdiv style=\"position: absolute; top: 0; right: 0;\"\u003e\n\u003ca href=\"https://github.com/GuillaumeDua/CppShelf\"\u003e\n\u003cimg loading=\"lazy\" width=\"149\" height=\"149\" src=\"https://github.blog/wp-content/uploads/2008/12/forkme_right_red_aa0000.png?resize=149%2C149\" class=\"attachment-full size-full\" alt=\"Fork me on GitHub\" data-recalc-dims=\"1\" align=\"right\"\nstyle=\"position: relative; top: 0; right: 0; z-index: 1;\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://guillaumedua.github.io/CppShelf/\"\u003e\n\u003cimg loading=\"lazy\" src=\"https://github.com/GuillaumeDua/CppShelf/blob/main/docs/details/images/gh-pages-logo.png?raw=true\" alt=\"Check documentation on GitHub-pages\" align=\"right\" class=\"attachment-full size-full\" height=\"40\"\nstyle=\"position: absolute; top: 0; right: 0; z-index: 3;\"\n\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n[![cmake-Ubuntu-clang](https://github.com/GuillaumeDua/CppShelf/actions/workflows/cmake-Ubuntu-clang.yml/badge.svg)](https://github.com/GuillaumeDua/CppShelf/actions/workflows/cmake-Ubuntu-clang.yml)\n[![cmake-Ubuntu-gcc](https://github.com/GuillaumeDua/CppShelf/actions/workflows/cmake-Ubuntu-gcc.yml/badge.svg)](https://github.com/GuillaumeDua/CppShelf/actions/workflows/cmake-Ubuntu-gcc.yml)  \n[![pages-build-deployment](https://github.com/GuillaumeDua/CppShelf/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/GuillaumeDua/CppShelf/actions/workflows/pages/pages-build-deployment)\n[![Deploy-doc-to-GitHub-Pages](https://github.com/GuillaumeDua/CppShelf/actions/workflows/docs_to_gh_pages.yml/badge.svg)](https://github.com/GuillaumeDua/CppShelf/actions/workflows/docs_to_gh_pages.yml)  \n[![GitHub license](https://img.shields.io/github/license/GuillaumeDua/CppShelf)](https://github.com/GuillaumeDua/CppShelf/blob/main/LICENSE)\n![GitHub top language](https://img.shields.io/github/languages/top/GuillaumeDua/CppShelf)\n[![GitHub issues](https://img.shields.io/github/issues/GuillaumeDua/CppShelf)](https://github.com/GuillaumeDua/CppShelf/issues)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/y/GuillaumeDua/CppShelf)\n\n---\n\nCollection of - ***S**ingle-**He**ader, header-only, C++ **l**ibraries **f**iles*.  \nPersonal incubator for various library ideas and experiences, and perhaps a hint of serendipity.\n\nThe libraries here could, once mature enough, become self-contained in a separated repository.\n\n---\n\n\u003cimg src=\"https://github.com/GuillaumeDua/CppShelf/blob/main/docs/details/images/Shelf_icons_created_by_juicy_fish_Flaticon.png?raw=true\" alt=\"\" align=\"left\" width=\"25\" height=\"25\" style=\"Padding: 5px\"/\u003e\n\n## Components - nested librairies\n\n### 📦 [ag](https://github.com/GuillaumeDua/CppShelf/blob/main/includes/ag/csl/ag.hpp)\n\nA **tuple-like** interface for **aggregates** type.\n\nProject's\n[documentation](https://guillaumedua.github.io/CppShelf/output/ag/),\n[dashboard](https://github.com/users/GuillaumeDua/projects/2)\n\n### 🌊 [wf](https://github.com/GuillaumeDua/CppShelf/blob/main/docs/details/markdown/wf.md)\n\nGeneric **eDSL** builder - *as a route pattern* - to best translate **workflow**/use-cases in C++\n\nSee project's\n[documentation](https://guillaumedua.github.io/CppShelf/output/wf/),\n[dashboard](https://github.com/GuillaumeDua/CppShelf/projects/1)\n\n### 🧙‍♂️ [mp](https://github.com/GuillaumeDua/CppShelf/blob/main/includes/mp/csl/mp.hpp)\n\nA collection of **C++ TMP** *(C++ template-metaprogramming)* utilities\n\nProject's [dashboard](https://github.com/users/GuillaumeDua/projects/3)\n\n### 🔬 [functional](https://github.com/GuillaumeDua/CppShelf/blob/main/includes/functional/csl/functional.hpp)\n\nFunction \u0026 overload traits\n\nSee project's\n[live demo on godbolt.org](https://godbolt.org/z/Gd7fMKK8e),\n[dashboard](https://github.com/users/GuillaumeDua/projects/5)\n\n### 🔎 [typeinfo](https://github.com/GuillaumeDua/CppShelf/blob/main/includes/typeinfo/csl/typeinfo.hpp)\n\nCompile-time demangler, for types \u0026 values.  \nInconsistent: for educational and debugging purpose only.\n\nSee project's\n[live demo on godbolt.org](https://godbolt.org/z/TsEWf5bGa),\n[dashboard](https://github.com/users/GuillaumeDua/projects/7)\n\n### ☔ [ensure](https://github.com/GuillaumeDua/CppShelf/blob/main/includes/ensure/csl/ensure.hpp)\n\nInterface-safety related components, including a configurable **strong-type** implementation.\n\nSee project's\n[dashboard](https://github.com/users/GuillaumeDua/projects/4)\n\n---\n\n\u003cimg src=\"https://raw.githubusercontent.com/isocpp/logos/master/cpp_logo.svg\" alt=\"\" align=\"left\" width=\"25\" height=\"25\" style=\"Padding: 5px\"/\u003e\n\n## Supported C++ standard\n\n| Library       | C++17 | C++20 | C++23 |\n| ------------- | :---: | :---: | :---- |\n| 📦 ag         | ❌   | ✅   | ✅    |\n| 🌊 wf         | ❌   | ✅   | *planned*\u003cbr\u003e[P1985 - Universal template parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1985r1.pdf)\u003cbr\u003e[P0847 - Deducing this](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0847r5.html) |\n| 🧙‍♂️ mp         | ❌   | ✅   | -     |\n| 🔬 functional | ❌   | ✅   | ✅    |\n| 🔎 typeinfo   | ❌   | ✅   | ✅    |\n| ☔ ensure     | ✅   | ✅   | ✅    |\n\n\u003e 💡 Note that implementation details might changes from a version to another,  \n\u003e and in some cases, the source file itself.\n\u003e\n\u003e For instance, we currently have:\n\u003e `\u003ccsl/ensure.hpp\u003e` which either includes `\u003ccsl/cxx_17/ensure.hpp\u003e`, or `\u003ccsl/cxx_20/ensure.hpp\u003e` when C++20 or greater is available.\n\n### About C++17 support\n\n💡 Backward compatibility with **C++17** requires additional effort and **IS NOT a priority** for now, beside specific requests.  \n\n### About C++23 support\n\n⚠️ Implementations details might change once specific **C++23** [features are supported](https://en.cppreference.com/w/cpp/compiler_support) by targeted compilers.  \n👉 See opened issue [tagged with C++23](https://github.com/GuillaumeDua/CppShelf/issues?q=is%3Aissue+is%3Aopen+label%3AC%2B%2B23).\n\n## Supported compilers\n\n| Compiler       | Min. version  | Recommended | Reason |\n| -------------- | ------------- | ----------- | ------ |\n| **`g++`**      | \u003e= 11.1.0     | \u003e= 13.2     | C++20  |\n| **`clang++`**  | \u003e= 13.0.1     | \u003e= 16.0.6   | C++20\u003cbr\u003eDecent support of [P0315r4 lambdas in unevaluated contexts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r4.pdf) |\n| **`msvc-cl`**  | *TBD*         | *TBD*       | -      |\n\n---\n\n## Getting started\n\n### Getting started - using CMake\n\n👉 This is the recommended way to integrate `csl` (or a subset of its components) to a project.\n\n- [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)\n\n    ```cmake\n    include(FetchContent)\n\n    # Forces csl a options ...\n    # example: set(CSL_ENABLE_ALL_TESTS OFF CACHE INTERNAL \"\")\n\n    FetchContent_Declare(\n        csl\n        GIT_REPOSITORY https://github.com/GuillaumeDua/CppShelf.git\n    )\n    FetchContent_MakeAvailable(csl)\n    ```\n\n- [ExternalProject_Add](https://cmake.org/cmake/help/latest/module/ExternalProject.html)\n\n#### CMake - options\n\nGeneral options:\n\n| Option                    | Type | Default | Description |\n| ------------------------- | ---- | ------- | ----------- |\n| `CSL_BUILD_ALL`           | bool | ON      | enable/disable all components **build**    |\n| `CSL_ENABLE_ALL_TESTS`    | bool | OFF     | enable/disable all components **tests**    |\n| `CSL_ENABLE_ALL_EXAMPLES` | bool | OFF     | enable/disable all components **examples** |\n\nComponents-specific options:\n\n| Option syntax                    | Type | Default                   | Description |\n| -------------------------------- | ---- | ------------------------- | ----------- |\n| `CSL_BUILD_\\\u003ccomponent_name\\\u003e`   | BOOL | `CSL_BUILD_ALL`           | enable/disable a specific component **build**   |\n| `CSL_TEST_\\\u003ccomponent_name\\\u003e`    | BOOL | `CSL_ENABLE_ALL_TESTS`    | enable/disable a specific component **test**    |\n| `CSL_EXAMPLE_\\\u003ccomponent_name\\\u003e` | BOOL | `CSL_ENABLE_ALL_EXAMPLES` | enable/disable a specific component **example** |\n\nFor options related to a specific component, refer to its dedicated documentation.\n\n### Getting started - header-only\n\nUsing the way you prefer, acquire a component/library file.\n\n- `wget` shell command\n- CMake [`file(DOWNLOAD \u003curl\u003e [\u003cfile\u003e] [...])`](https://cmake.org/cmake/help/latest/command/file.html)\n- etc.\n\nUse it in your project using an `#include` preprocessor directive.  \nRefer to the component's documention to check for configuration preprocessor constant.\n\nExample:\n\n```cpp\n#define CSL_ENSURE__ENABLE_FMT_SUPPORT // enable `fmt` support, if available\n#include \u003ccsl/ensure.hpp\u003e\n\nvoid func(){\n    using meters = csl::ensure::strong_type\u003cint, struct meter_tag\u003e;\n    fmt::print(meters{ 42 });\n}\n```\n\n### In [Compiler Explorer](https://godbolt.org/)\n\nSee [demonstration here](https://godbolt.org/z/4aGfEbf8d).\n\n```cpp\n#include \u003ciostream\u003e\n\n#include \u003chttps://raw.githubusercontent.com/GuillaumeDua/CppShelf/main/includes/typeinfo/csl/typeinfo.hpp\u003e\n#include \u003chttps://raw.githubusercontent.com/GuillaumeDua/CppShelf/main/includes/ag/csl/ag.hpp\u003e\n\nstruct some_model {\n    char c = 'A';\n    int i = 42;\n};\n\nauto main() -\u003e int {\n    std::cout\n        \u003c\u003c csl::typeinfo::type_name_v\u003c\n            csl::ag::element_t\u003c0, some_model\u003e // \"char\"\n           \u003e\n    ;\n    return csl::ag::get\u003c1\u003e(some_model{}); // 42\n}\n```\n\nPossible output:\n\n```\nProgram returned: 42\nProgram stdout\nchar\n```\n\n---\n\n## Misc\n\nThis Readme.md 's ressources\n\n- [Shelf icons created by juicy_fish - Flaticon](https://www.flaticon.com/free-icons/shelf)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguillaumedua%2Fcppshelf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguillaumedua%2Fcppshelf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguillaumedua%2Fcppshelf/lists"}