{"id":18736894,"url":"https://github.com/bitwizeshift/bit-stl","last_synced_at":"2025-04-12T19:32:03.069Z","repository":{"id":81485333,"uuid":"80256758","full_name":"bitwizeshift/bit-stl","owner":"bitwizeshift","description":"A header-only library of custom template types. This is the standard library for most personal libraries","archived":false,"fork":false,"pushed_at":"2018-08-15T21:22:32.000Z","size":2988,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-26T14:02:24.998Z","etag":null,"topics":["c-plus-plus-14","cpp14","standard-library"],"latest_commit_sha":null,"homepage":null,"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/bitwizeshift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2017-01-28T00:10:46.000Z","updated_at":"2023-05-15T03:22:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"a8e697d5-3e29-47d2-b6d8-7e9dbc3eb17b","html_url":"https://github.com/bitwizeshift/bit-stl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fbit-stl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fbit-stl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fbit-stl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2Fbit-stl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitwizeshift","download_url":"https://codeload.github.com/bitwizeshift/bit-stl/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248621206,"owners_count":21134775,"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":["c-plus-plus-14","cpp14","standard-library"],"created_at":"2024-11-07T15:22:52.689Z","updated_at":"2025-04-12T19:32:03.063Z","avatar_url":"https://github.com/bitwizeshift.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `bit::stl` Standard library\n\n[![Build Status](https://travis-ci.org/bitwizeshift/bit-stl.svg?branch=master)](https://travis-ci.org/bitwizeshift/bit-stl)\n[![Build status](https://ci.appveyor.com/api/projects/status/q3k3qns2amtdhliy?svg=true)](https://ci.appveyor.com/project/bitwizeshift/bit-stl)\n[![Github Issues](https://img.shields.io/github/issues/bitwizeshift/bit-stl.svg)](http://github.com/bitwizeshift/bit-stl/issues)\n[![Tested Compilers](https://img.shields.io/badge/compilers-gcc%20%7C%20clang%20%7C%20msvc-blue.svg)](#tested-compilers)\n[![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](http://bitwizeshift.github.io/bit-stl)\n[![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/bitwizeshift/bit-stl/master/LICENSE.md)\n[![Github Releases](https://img.shields.io/github/release/bitwizeshift/bit-stl.svg)](https://github.com/bitwizeshift/bit-stl/releases)\n\n## What is `bit::stl`?\n\nThis is the standard template library for various personal projects of mine.\nIt is both an extension to the C++ standard library, along with a custom implementation\nof future-proof components (such as c++17 features like std::string_view that is not\navailable to a c++14 compiler).\n\n## What does this library offer?\n\nThis is a core-library intended as an extension to the standard C++ library.\n\nIt offers various lightweight/useful utilities that are otherwise missing from the standard library.\nFor example:\n\n- Extended type traits that support plural type comparison (`are_same`, `is_derived_from_all`, etc)\n- GSL suggested types (`span`,`string_span`)\n- Type-erased types (`array_view`,`map_view`,`set_view`)\n- EBO generic storage types (`compressed_tuple`,`compressed_pair`)\n- Dynamic constant types (`dynamic_size_constant`,`dynamic_index_constant`). These allow runtime _or_ compile-time constant values\n- Circular buffers (`circular_deque`,`circular_queue`,`circular_buffer`)\n- Concepts! (More on this below)\n- Many other useful utilities\n\n**Note** This is _not_ intended as a replacement for the C++ standard library; just a supplement.\n\n### Concepts\n\nThis library includes a series of type-traits that validate types for satisfying specific concepts.\n\nThis is not a true C++ Concepts Light implementation, since it is unable to provide proper diagnostics for which requirements are missed. But it does offer type validation where necessary, allowing for better SFINAE on template types.\n\nFor example, to test whether a type satisfies a `Container` concept, a trait called `is_container` can be used\n\n### Directory Structuring\n\nAlthough this library does provide C++17 utilities, this primarily acts as a core library extension, and does not follow 1-1 with\nthe standard. Some example differences are:\n\n- Composite standard headers are decomposed into individual header files. For example, type trait types are all in individual header files under a `traits` subsystem (unlike the standard's `type_traits` header that contains everything)\n- The various utility headers are in a `utility` subsystem; likewise, container additions (like `string_view`) are under a `container` subsystem.\n\n### Simple Namespacing\n\nThe namespace convention is simple; all components reside within `namespace bit::stl`.\n\nThere are two common `inline namespace`s as well that can be brought in independently; `inline namespace casts` and `inline namespace literals`. The `casts` namespace can be used to bring things like `pointer_cast` or `narrow_cast` to the top-level without\nrequiring polluting the entire global namespace, whereas the `literals` namespace, much like the standard library, brings in\nany `operator \"\"` literals.\n\n## Using this library\n\n### Building \u0026 Installing\n\nBuilding `bit::stl` is simple, and only requires a CMake version greater than 3.1, and a compatible compiler.\n\nFist, make a directory to build the library in, then build with CMake\n\n```bash\nmkdir build\ncd build\n\ncmake . -DBIT_STL_BUILD_UNIT_TESTS=Off -DBIT_STL_BUILD_INDEPENDENCE_TESTS=Off  # ... any additional toolchain parameters ...\ncmake --build .\n```\n\nOmitting the `-DBIT_STL_BUILD_UNIT_TESTS=Off` will build unit tests; likewise `DBIT_STL_BUILD_INDEPENDENCE_TESTS=Off` will\nbuild header-independence checks (building each header independently to ensure there are no header-order based transitive dependencies).\n\nTo install, run:\n\n```bash\ncmake --build . --target install\n```\n\nTo change the output directory of the installation, you can export `BIT_HOME` to install to a specific directory\n\n```bash\nexport BIT_HOME=/etc/bit\ncmake --build . --target install\n```\n\nwill install into `/etc/bit/`.\n\n### Through a `cmake` subdirectory\n\nClone/copy/subtree the contents of this repository to a subdirectory, and `add_subdirectory` the directory containing `bit::stl`.\n\nTo add a dependency to the library, just add `target_link_libraries(\u003cyour target\u003e [PUBLIC|INTERFACE|PRIVATE] bit::stl)`\n\n## \u003ca name=\"tested-compilers\"\u003e\u003c/a\u003eTested Compilers\n\nThe following compilers are currently being tested through continuous integration with [Travis](https://travis-ci.org/bitwizeshift/bit-stl) and [AppVeyor](https://ci.appveyor.com/project/bitwizeshift/bit-stl/)\n\nNote that `bit-stl` only works on compiler that provide proper conformance for c++14\n\n| Compiler              | Operating System                   |\n|-----------------------|------------------------------------|\n| g++ 6.3.0             | Ubuntu 14.04.3 TLS                 |\n| g++ 7.2.0             | Ubuntu 14.04.3 TLS                 |\n| clang++ 3.9.0         | Ubuntu 14.04.3 TLS                 |\n| clang++ 4.0.1         | Ubuntu 14.04.3 TLS                 |\n| clang xcode 7.3       | Darwin Kernel 15.6.0 (OSX 10.11.6) |\n| clang xcode 8.0       | Darwin Kernel 15.6.0 (OSX 10.11.6) |\n| clang xcode 8.1       | Darwin Kernel 16.1.0 (OSX 10.12.1) |\n| clang xcode 8.2       | Darwin Kernel 16.1.0 (OSX 10.12.1) |\n| clang xcode 8.3       | Darwin Kernel 16.6.0 (OSX 10.12.5) |\n| clang xcode 9.0       | Darwin Kernel 16.7.0 (OSX 10.12.6) |\n| Visual Studio 2017    | Windows Server 2016 (x64)          |\n\n## \u003ca name=\"license\"\u003e\u003c/a\u003eLicense\n\n\u003cimg align=\"right\" src=\"http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png\"\u003e\n\nThe class is licensed under the [MIT License](http://opensource.org/licenses/MIT):\n\nCopyright \u0026copy; 2017 Matthew Rodusek\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwizeshift%2Fbit-stl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitwizeshift%2Fbit-stl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwizeshift%2Fbit-stl/lists"}