{"id":20674783,"url":"https://github.com/ramirisu/gul","last_synced_at":"2025-06-21T07:41:07.855Z","repository":{"id":64005396,"uuid":"558024635","full_name":"Ramirisu/gul","owner":"Ramirisu","description":"header-only general utilities library for C++11","archived":false,"fork":false,"pushed_at":"2022-12-31T08:32:25.000Z","size":275,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T18:37:06.807Z","etag":null,"topics":["cpp","cpp11","header-only"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ramirisu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-26T18:52:47.000Z","updated_at":"2022-12-16T19:35:27.000Z","dependencies_parsed_at":"2023-01-14T18:30:35.362Z","dependency_job_id":null,"html_url":"https://github.com/Ramirisu/gul","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Fgul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Fgul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Fgul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Fgul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ramirisu","download_url":"https://codeload.github.com/Ramirisu/gul/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Fgul/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259063489,"owners_count":22799715,"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","cpp11","header-only"],"created_at":"2024-11-16T21:07:26.585Z","updated_at":"2025-06-10T11:06:59.688Z","avatar_url":"https://github.com/Ramirisu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GUL\n\n[![build](https://github.com/Ramirisu/gul/actions/workflows/build_matrix.yml/badge.svg)](https://github.com/Ramirisu/gul/actions/workflows/build_matrix.yml)\n[![codecov](https://codecov.io/gh/Ramirisu/gul/branch/main/graph/badge.svg?token=XEKI3XKCK0)](https://codecov.io/gh/Ramirisu/gul)\n[![codeql](https://github.com/Ramirisu/gul/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/Ramirisu/gul/actions/workflows/codeql.yml)\n![std](https://img.shields.io/badge/std-11%2F14%2F17%2F20-blue.svg)\n![license](https://img.shields.io/badge/license-BSL--1.0-blue)\n\ngul is an open-source library providing general utilities for c++11. Many of them are backported from later standard version.\n\n## Features\n\n* Header-only, no external dependencies.\n* Support exceptions disabled with `-fno-exceptions`.\n\n|   Utility Class    | Description                                                                                                                                                                                                    | From std?                                                           |\n| :----------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ |\n|       `byte`       | A type represents the byte concept.                                                                                                                                                                            | [c++17](https://en.cppreference.com/w/cpp/types/byte)               |\n|     `optional`     | A type either holds a value of type `T`, or is in *valueless* state.\u003cbr /\u003eExtensions:\u003cul\u003e\u003cli\u003e`optional\u003cvoid\u003e`\u003c/li\u003e\u003cli\u003e`optional\u003cT\u0026\u003e`\u003c/li\u003e\u003cli\u003e`optional::to_expected_or`\u003c/li\u003e\u003c/ul\u003e                              | [c++17, 20, 23](https://en.cppreference.com/w/cpp/utility/optional) |\n|     `expected`     | A type either holds a value of type `T`, or an *unexpected* value of type `E`.\u003cbr /\u003eExtensions:\u003cul\u003e\u003cli\u003e`expected\u003cT\u0026, E\u003e`\u003c/li\u003e\u003cli\u003e`expected::value_to_optional`\u003c/li\u003e\u003cli\u003e`expected::error_to_optional`\u003c/li\u003e\u003c/ul\u003e | [c++23](https://en.cppreference.com/w/cpp/utility/expected)         |\n| `integer_sequence` | A compile-time sequence of integers.                                                                                                                                                                           | [c++14](https://en.cppreference.com/w/cpp/utility/integer_sequence) |\n\n|                                                  Utility Function                                                  | Description                                                            |                            From std?                             |\n| :----------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------- | :--------------------------------------------------------------: |\n|                                                     `exchange`                                                     | Replaces the argument with a new value and returns its previous value. | [c++14, 23](https://en.cppreference.com/w/cpp/utility/exchange)  |\n|                                                     `as_const`                                                     | Obtains a reference to const to its argument.                          |   [c++17](https://en.cppreference.com/w/cpp/utility/as_const)    |\n| `cmp_equal`\u003cbr /\u003e`cmp_not_equal`\u003cbr /\u003e`cmp_less`\u003cbr /\u003e`cmp_greater`\u003cbr /\u003e`cmp_less_equal`\u003cbr /\u003e`cmp_greater_equal` | Compares two integer values without value change caused by conversion. |    [c++20](https://en.cppreference.com/w/cpp/utility/intcmp)     |\n|                                                  `to_underlying`                                                   | Converts an enumeration to its underlying type.                        | [c++23](https://en.cppreference.com/w/cpp/utility/to_underlying) |\n\n|        Functional        |                              From std?                               |\n| :----------------------: | :------------------------------------------------------------------: |\n| `invoke`\u003cbr /\u003e`invoke_r` | [c++17](https://en.cppreference.com/w/cpp/utility/functional/invoke) |\n\n|             Memory             |                           From std?                           |\n| :----------------------------: | :-----------------------------------------------------------: |\n|   `out_ptr`\u003cbr /\u003e`out_ptr_t`   |  [c++23](https://en.cppreference.com/w/cpp/memory/out_ptr_t)  |\n| `inout_ptr`\u003cbr /\u003e`inout_ptr_t` | [c++23](https://en.cppreference.com/w/cpp/memory/inout_ptr_t) |\n\n|                                   Container                                   | Description                                                                                                                                                                                                                                  |                                  From std?                                  |\n| :---------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------: |\n| `string_view`\u003cbr /\u003e`wstring_view`\u003cbr /\u003e`u16string_view`\u003cbr /\u003e`u32string_view` | A non-owning type can refer to a constant contiguous sequence of `char`-like objects with the first element of the sequence at position zero.\u003cbr /\u003eExtensions:\u003cul\u003e\u003cli\u003e`basic_string_view::first`\u003c/li\u003e\u003cli\u003e`basic_string_view::last`\u003c/li\u003e\u003c/ul\u003e | [c++17, 20, 23](https://en.cppreference.com/w/cpp/string/basic_string_view) |\n|                                    `span`                                     | A type can refer to a contiguous sequence of objects with the first element of the sequence at position zero.                                                                                                                                |          [c++20](https://en.cppreference.com/w/cpp/container/span)          |\n|                                  `fifo_map`                                   | An associative container that contains key-value pairs with unique keys. `Key`s are sorted by insertion order.                                                                                                                               |                                    none                                     |\n|                                   `lru_map`                                   | An associative container that contains key-value pairs with at most `capacity` unique keys. The least recently used `Key` will be purged when the map is full during insertion.                                                              |                                    none                                     |\n\n|                                             Type Traits                                              |                              From std?                              |\n| :--------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------: |\n|                                          `is_null_pointer`                                           |  [c++14](https://en.cppreference.com/w/cpp/types/is_null_pointer)   |\n|                                       `is_nothrow_convertible`                                       |   [c++20](https://en.cppreference.com/w/cpp/types/is_convertible)   |\n| `is_swappable_with`\u003cbr /\u003e`is_swappable`\u003cbr /\u003e`is_nothrow_swappable_with`\u003cbr /\u003e`is_nothrow_swappable` |    [c++17](https://en.cppreference.com/w/cpp/types/is_swappable)    |\n|                                          `is_bounded_array`                                          |  [c++20](https://en.cppreference.com/w/cpp/types/is_bounded_array)  |\n|                                         `is_unbounded_array`                                         | [c++20](https://en.cppreference.com/w/cpp/types/is_unbounded_array) |\n|                                           `is_scoped_enum`                                           |   [c++23](https://en.cppreference.com/w/cpp/types/is_scoped_enum)   |\n|                                 `is_invocable`\u003cbr /\u003e`is_invocable_r`                                 |    [c++17](https://en.cppreference.com/w/cpp/types/is_invocable)    |\n|                                        `is_specialization_of`                                        |                                none                                 |\n|                                  `conjunction`\u003cbr /\u003e`conjunction_t`                                  |    [c++17](https://en.cppreference.com/w/cpp/types/conjunction)     |\n|                                  `disjunction`\u003cbr /\u003e`disjunction_t`                                  |    [c++17](https://en.cppreference.com/w/cpp/types/disjunction)     |\n|                                     `negation`\u003cbr /\u003e`negation_t`                                     |      [c++17](https://en.cppreference.com/w/cpp/types/negation)      |\n|                                `invoke_result`\u003cbr /\u003e`invoke_result_t`                                |     [c++17](https://en.cppreference.com/w/cpp/types/result_of)      |\n|                                               `void_t`                                               |       [c++17](https://en.cppreference.com/w/cpp/types/void_t)       |\n|                                 `remove_cvref`\u003cbr /\u003e`remove_cvref_t`                                 |    [c++20](https://en.cppreference.com/w/cpp/types/remove_cvref)    |\n|                                `type_identity`\u003cbr /\u003e`type_identity_t`                                |   [c++20](https://en.cppreference.com/w/cpp/types/type_identity)    |\n|                                          `function_traits`                                           |                                none                                 |\n\n## Integration\n\nRequirements\n\n* CMake 3.15 (or later)\n* GCC 4.8 (or later)\n* Clang 3.5 (or later)\n* MSVC 2015 v140 (or later)\n* Apple Clang 12 (or later)\n\nCMake\n\n```cmake\n  add_executable(name)\n  target_link_libraries(name PRIVATE gul)\n```\n\ngul is header-only. Just `#include` the header file `all.hpp` to utilize all features.\n\n```cpp\n  #include \u003cgul/all.hpp\u003e\n```\n\n## Building tests\n\nCMake\n\n| Option             | Description                | Value  | Default |\n| :----------------- | :------------------------- | :----: | :-----: |\n| GUL_BUILD_TESTS    | Build tests                | ON/OFF |   OFF   |\n| GUL_ENABLE_CODECOV | Enable code coverage build | ON/OFF |   OFF   |\n\n```sh\ncd gul/\ncmake -B build -DGUL_BUILD_TESTS=ON\ncmake --build build\ncd build \u0026\u0026 ctest \u0026\u0026 cd ..\n```\n\n## License\n\nThis project is distributed under the [Boost Software License 1.0](https://www.boost.org/LICENSE_1_0.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framirisu%2Fgul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framirisu%2Fgul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framirisu%2Fgul/lists"}