{"id":33002950,"url":"https://github.com/iboB/itlib","last_synced_at":"2025-11-15T11:01:21.068Z","repository":{"id":38321036,"uuid":"304015996","full_name":"iboB/itlib","owner":"iboB","description":"A collection of std-like single-header C++ libraries","archived":false,"fork":false,"pushed_at":"2025-10-24T12:31:36.000Z","size":799,"stargazers_count":194,"open_issues_count":5,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-24T14:32:51.981Z","etag":null,"topics":["collection","cpp","expected","flat-map","generator","static-vector"],"latest_commit_sha":null,"homepage":"","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/iboB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-14T12:59:51.000Z","updated_at":"2025-10-24T12:31:39.000Z","dependencies_parsed_at":"2023-12-29T13:33:20.108Z","dependency_job_id":"d609da39-bdbd-46c7-8cf5-80229db8885e","html_url":"https://github.com/iboB/itlib","commit_stats":{"total_commits":364,"total_committers":4,"mean_commits":91.0,"dds":0.01098901098901095,"last_synced_commit":"40f4d7910090f9785734455ea8662bf28f12e187"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/iboB/itlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fitlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fitlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fitlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fitlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iboB","download_url":"https://codeload.github.com/iboB/itlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fitlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284545264,"owners_count":27023524,"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","status":"online","status_checked_at":"2025-11-15T02:00:06.050Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["collection","cpp","expected","flat-map","generator","static-vector"],"created_at":"2025-11-13T14:00:38.902Z","updated_at":"2025-11-15T11:01:21.055Z","avatar_url":"https://github.com/iboB.png","language":"C++","readme":"\nitlib: iboB's Template Libraries\n================================\n\nA collection of small single-header C++ libraries similar to or extending the C++ standard library. See below for a list.\n\n[![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nitlib was forked from [chobo-shl](https://github.com/Chobolabs/chobo-shl) which is no longer supported. New libraries and updates to the existing ones are added here.\n\n## Build Status\n\nBuilding with GitHub actions on Windows with MSVC, Ubuntu with GCC, and macOS with clang. Debug and Release. With address sanitizer and thread sanitizer where applicable.\n\n[![Build](https://github.com/iboB/itlib/workflows/Build/badge.svg)](https://github.com/iboB/itlib/actions?query=workflow%3ABuild)\n\n## Libraries\n\nEvery `.hpp` file in `include/itlib` is a standalone library and has no dependencies other than the standard lib.\n\nDocumentation is provided in comments at the top of each file.\n\nIn the list below each library shows its minimum supported C++ standard and has icons for other standards if additional features are available for them.\n\n Library | Description\n---------|-------------\n [**any.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/any.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | An alternative implementation of C++17's `std::any` without the limitation of required copyability for the values inside and with the possibility to set a custom allocator.\n [**atomic.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/atomic.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Utility extensions for `\u003catomic\u003e`.\n [**atomic_shared_ptr_storage.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/atomic_shared_ptr_storage.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A wrapper for `std::shared_ptr\u003cT\u003e` which allows atomic load, store and exchange. An alternative to C++20's `std::atomic\u003cstd::shared_ptr\u003cT\u003e\u003e`.\n [**data_mutex.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/data_mutex.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A template pair of an object and a mutex used to synchronize access to it. It makes it hard to cause bugs by forgetting to lock a mutex associated with an object. \n [**dynamic_bitset.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/dynamic_bitset.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A class similar to `std::bitset`, but the number of bits is not a part of the type. It's also somewhat similar to `std::vector\u003cbool\u003e`, but (so far) it has more limited modification capabilities.\n [**expected.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/expected.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A union type of a value and an error. Similar to the [`std::expected`](https://en.cppreference.com/w/cpp/utility/expected) from C++23.\n [**flat_map.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/flat_map.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A class with the interface of `std::map` but implemented with an underlying `std::vector`-type container, thus providing better cache locality of the elements. Similar to [`boost::flat_map`](http://www.boost.org/doc/libs/1_61_0/doc/html/boost/container/flat_map.html) with the notable difference that the underlying container can be changed via a template argument.\n [**flat_set.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/flat_set.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A class with the interface of `std::set` but implemented with an underlying `std::vector`-type container, thus providing better cache locality of the elements. Similar to [`boost::flat_set`](http://www.boost.org/doc/libs/1_61_0/doc/html/boost/container/flat_set.html) with the notable difference that the underlying container can be changed via a template argument.\n [**generator.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/generator.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-20-purple.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A helper for making simple generator coroutines with `co_yield`.\n [**mem_streambuf.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/mem_streambuf.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Two helper classes: `mem_ostreambuf` and `mem_istreambuf` which allow you to work with `std::stream`-s with buffers of contiguous memory.\n [**opt_ref_buffer.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/opt_ref_buffer.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-20-purple.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A buffer that can either point to (reference) or own a contiguous block of memory\n [**pmr_allocator.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/pmr_allocator.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A C++17 wrapper of `std::pmr::polymorphic_allocator` which provides functionalities introduced in C++20 for it.\n [**pod_vector.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/pod_vector.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A container similar to `std::vector`, which contains PODs. This fact is used to improve performance by skipping constructor and destructor calls and using `memcpy` and `memmove` to copy data, and `malloc` and `free`, and, most importantly `realloc`, and `_expand` if available, to manage memory.\n [**poly_span.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/poly_span.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A class similar to C++20's `std::span` which offers a polymorphic view over a buffer of objects.\n [**qalgorithm.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/qalgorithm.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Wrappers of `\u003calgorithm\u003e` functions which work on entire containers for less typing in the most common use-cases.\n [**rand_dist.hpp**](https://github.com/iboB/itlib/blob/master/include/itlib/rand_dist.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Alternative random distributions compatible with std::random.\n [**rstream.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/rstream.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Read stream. Simple `std::istream` wrappers which don't allow seeks, allowing you to be certain that reads are sequential, and thus allow a redirect, so you can represent several streams as one.\n [**sentry.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/sentry.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A sentry class which executes a function object on destruction. Works with C++11, but it's slightly easier to use with C++17.\n [**shared_from.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/shared_from.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A helper class to replace `std::enable_shared_from_this` providing a more powerful interface. Similar to `enable_shared_from` from [Boost.SmartPtr](https://www.boost.org/doc/libs/1_75_0/libs/smart_ptr/doc/html/smart_ptr.html#enable_shared_from)\n [**small_vector.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/small_vector.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A mix between `std::vector` and `itlib::static_vector`. It's a dynamic array, optimized for use when the number of elements is small. Like `static_vector` is has a static buffer with a given capacity, but can fall back to dynamically allocated memory, should the size exceed it. Similar to [`boost::small_vector`](http://www.boost.org/doc/libs/1_61_0/doc/html/boost/container/small_vector.html)\n [**span.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/span.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A C++11 implementation of C++20's `std::span`\n [**static_vector.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/static_vector.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A mix between `std::vector` and `std::array`: A dynamically sized container with fixed capacity (supplied as a template parameter). This allows you to have dynamically sized vectors on the stack or as cache-local value members, as long as you know a big enough capacity beforehand. Similar to [`boost::static_vector`](http://www.boost.org/doc/libs/1_61_0/doc/html/boost/container/static_vector.html).\n [**stride_span.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/stride_span.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A C++11 implementation C++20's of std::span with a dynamic extent *and an associated stride*.\n [**strutil.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/strutil.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A collection of small utilities for `std::string_view`\n [**throw_ex.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/throw_ex.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Utility to compose and throw exceptions on a single line\n [**time_t.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/time_t.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | A thin wrapper of `std::time_t` which provides thread safe `std::tm` getters and type-safe (`std::chrono::duration`-based) arithmetic\n [**type_traits.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/type_traits.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![Standard](https://img.shields.io/badge/C%2B%2B-17-red.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)  | Additional type traits to extend the standard library's `\u003ctype_traits\u003e`\n [**ufunction.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/ufunction.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![Standard](https://img.shields.io/badge/C%2B%2B-14-yellow.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Unique function. A replacement of `std::function` which is non-copyable (can capture non-copyable values, and wrap non-copyable objects), and noexcept move-constructible (won't implicitly make owners no-noexcept move-constructible)\n  [**utility.hpp**](https://github.com/iboB/itlib/tree/master/include/itlib/utility.hpp) [![Standard](https://img.shields.io/badge/C%2B%2B-11-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | Several generally unrelated utility functions and helpers\n\n## Usage\n\nClone the repo or choose one or more libraries that you like and copy them somewhere in your include paths.\n\nEvery library is self-contained so you can copy, move, and modify whichever you like and not wory about interdependencies.\n\n## Contributing\n\nPull requests and issues are welcome.\n\nPlease make separate commits per library, tagging them with the library name in the title with brackets. Example:\n\n* *[small_vector] Added insert methods*\n* *[flat_map] Crash when using with xxxx container*\n\nYou can use CMake to generate a project and run the tests locally.\n\n## Copyright\n\nCopyright \u0026copy; 2016-2019 [Chobolabs Inc.](http://www.chobolabs.com/)\n\nCopyright \u0026copy; 2020-2025 Borislav Stanimirov\n\nThese libraries are distributed under the MIT Software License. See LICENSE.txt for further details or copy [here](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Frameworks","Standard/Support Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FiboB%2Fitlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FiboB%2Fitlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FiboB%2Fitlib/lists"}