{"id":21653606,"url":"https://github.com/karnkaul/ktl","last_synced_at":"2025-04-11T21:01:03.534Z","repository":{"id":41376201,"uuid":"390611609","full_name":"karnkaul/ktl","owner":"karnkaul","description":"Collection of ktl header libraries - small C++20 wrapper utilities","archived":false,"fork":false,"pushed_at":"2022-08-15T03:30:19.000Z","size":99,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T16:55:35.178Z","etag":null,"topics":["async-queue","bitflags","cpp","cpp20","cpp20-library","future","header-only","library","n-tree","not-null","result","stl","thread","threading"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karnkaul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-29T05:32:52.000Z","updated_at":"2024-09-29T17:34:04.000Z","dependencies_parsed_at":"2022-08-10T02:06:58.183Z","dependency_job_id":null,"html_url":"https://github.com/karnkaul/ktl","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karnkaul%2Fktl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karnkaul%2Fktl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karnkaul%2Fktl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karnkaul%2Fktl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karnkaul","download_url":"https://codeload.github.com/karnkaul/ktl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480434,"owners_count":21110936,"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":["async-queue","bitflags","cpp","cpp20","cpp20-library","future","header-only","library","n-tree","not-null","result","stl","thread","threading"],"created_at":"2024-11-25T08:19:31.372Z","updated_at":"2025-04-11T21:01:03.033Z","avatar_url":"https://github.com/karnkaul.png","language":"C++","readme":"## KTL\n\nA lightweight set of utility headers written in C++20.\n\n### Usage\n\n**Requirements**\n\n- CMake\n- C++20 compiler (and stdlib)\n\n**Steps**\n\n1. Clone repo to appropriate subdirectory, say `ktl`\n1. Add library to project via: `add_subdirectory(ktl)` and `target_link_libraries(foo ktl::ktl)`\n1. Use desired headers via `#include \u003cktl/header.hpp\u003e`\n\n### Headers\n\n#### `async/async_queue.hpp`\n\nFIFO queue with thread safe \"sleepy\" API.\n\nFeatures:\n\n- Policy customization\n- Multiple queues\n- Thread-safe push-and-notify (to any desired queue)\n- Thread-safe wait-and-pop (from first of any desired queues)\n- Clear all queues and return residue\n- Deactivate all queues (as secondary wait condition)\n\n#### `async/kfuture.hpp`\n\nAsync operation / shared state wrappers, with `.then()` support.\n\n#### `async/kfunction.hpp`\n\nCallable wrapper that cannot be copied, only moved. Used in `kpackaged_task` and `kfuture`.\n\n#### `async/kthread.hpp`\n\n`std::thread` wrapper that joins on destruction / move, and supports `stop_t` tokens.\n\n#### `async/kmutex.hpp`\n\nBasic and strict wrappers for a `T` and its (mutable) mutex, stdlib RAII lock types.\n\n#### `async/shared_kmutex.hpp`\n\nAliases of `tmutex` with `std::shared_mutex`.\n\n#### `enum_flags/enum_flags.hpp`\n\nWrapper around an integral type used as bit flags.\n\n#### `enum_flags/bitflags.hpp`\n\nFree functions for working with integral bit flags.\n\n#### `byte_array.hpp`\n\nLightweight, resizeable wrapper over `std::unique_ptr\u003cstd::byte[]\u003e`.\n\n#### `debug_trap.hpp`\n\nx86/x64 debugger trap/break.\n\n#### `delegate.hpp`\n\nTagged observer store with RAII signals.\n\n#### `either.hpp`\n\nRAII union of two types.\n\n#### `enumerate.hpp`\n\nWrapper for indexed iteration over ranges represented by pairs of iterators.\n\n#### `expected.hpp`\n\nUnion of expected and unexpected types; uses `either.hpp`.\n\n#### `fifo_map.hpp`\n\nFirst-In First-Out map.\n\n#### `fixed_any.hpp`\n\nFixed-size type erased storage.\n\n#### `fixed_vector.hpp`\n\nFixed-size vector-like container using bytearray as storage.\n\n#### `hash_table.hpp`\n\nLightweight hash-table with open addressing and reduced iterator stability.\n\n#### `kformat.hpp`\n\nLightweight fmt-like `std::string` interpolation with basic formatting support.\n\n#### `kunique_ptr.hpp`\n\nLightweight unique pointer to heap-allocated Type*.\n\n#### `kversion.hpp`\n\nSemantic version.\n\n#### `monotonic_map.hpp`\n\nWrapper over an (un)ordered map that associates each T with a unique RAII handle which can be used to unregister the instance.\n\n#### `n_tree.hpp`\n\nModels a \"forward\" N-tree (no parent link) via `std::forward_list`.\n\n#### `not_null.hpp`\n\nWrapper for raw / smart pointers that is restricted from being null.\n\n#### `ring_buffer.hpp`\n\nRotating ring-buffer using contiguous storage (`std::vector\u003cT\u003e` by default). Overwrites on overflow.\n\n#### `ring_counter.hpp`\n\nFixed-size rotating integral counter. Supports increment/decrement.\n\n### Contributing\n\nPull/merge requests are welcome.\n\n**[Original Repository](https://github.com/karnkaul/ktl)**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarnkaul%2Fktl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarnkaul%2Fktl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarnkaul%2Fktl/lists"}