{"id":18736896,"url":"https://github.com/bitwizeshift/backportcpp","last_synced_at":"2025-04-12T19:32:05.249Z","repository":{"id":54826820,"uuid":"244076663","full_name":"bitwizeshift/BackportCpp","owner":"bitwizeshift","description":"Library of backported modern C++ types to work with C++11","archived":false,"fork":false,"pushed_at":"2022-01-23T04:07:42.000Z","size":2825,"stargazers_count":79,"open_issues_count":5,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T14:01:43.980Z","etag":null,"topics":["any","backport","best-practices","c-plus-plus-11","c-plus-plus-14","cpp11","cpp14","cpp17","cpp20","header-only","modern-cpp","no-dependencies","optional","span","standard-library","standard-template-library","stl","string-view","template-metaprogramming","variant"],"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":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null},"funding":{"github":["bitwizeshift"],"patreon":"bitwizeshift","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/dsq3XCcBE"}},"created_at":"2020-03-01T02:56:43.000Z","updated_at":"2025-03-05T01:06:20.000Z","dependencies_parsed_at":"2022-08-14T04:00:56.531Z","dependency_job_id":null,"html_url":"https://github.com/bitwizeshift/BackportCpp","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2FBackportCpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2FBackportCpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2FBackportCpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitwizeshift%2FBackportCpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitwizeshift","download_url":"https://codeload.github.com/bitwizeshift/BackportCpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248621216,"owners_count":21134777,"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":["any","backport","best-practices","c-plus-plus-11","c-plus-plus-14","cpp11","cpp14","cpp17","cpp20","header-only","modern-cpp","no-dependencies","optional","span","standard-library","standard-template-library","stl","string-view","template-metaprogramming","variant"],"created_at":"2024-11-07T15:22:52.986Z","updated_at":"2025-04-12T19:32:04.946Z","avatar_url":"https://github.com/bitwizeshift.png","language":"C++","readme":"![Backport C++](doc/images/backport-logo.png)\n\n[![Ubuntu Build Status](https://github.com/bitwizeshift/BackportCpp/workflows/Ubuntu/badge.svg?branch=master)](https://github.com/bitwizeshift/BackportCpp/actions?query=workflow%3AUbuntu)\n[![macOS Build Status](https://github.com/bitwizeshift/BackportCpp/workflows/macOS/badge.svg?branch=master)](https://github.com/bitwizeshift/BackportCpp/actions?query=workflow%3AmacOS)\n[![Windows Build Status](https://github.com/bitwizeshift/BackportCpp/workflows/Windows/badge.svg?branch=master)](https://github.com/bitwizeshift/BackportCpp/actions?query=workflow%3AWindows)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/64b1ffd7f95b488eb70a11ee21eb1792)](https://www.codacy.com/manual/bitwizeshift/BackportCpp?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=bitwizeshift/BackportCpp\u0026amp;utm_campaign=Badge_Grade)\n[![Coverage Status](https://coveralls.io/repos/github/bitwizeshift/BackportCpp/badge.svg?branch=master)](https://coveralls.io/github/bitwizeshift/BackportCpp?branch=master)\n[![Github Issues](https://img.shields.io/github/issues/bitwizeshift/BackportCpp.svg)](http://github.com/bitwizeshift/BackportCpp/issues)\n\u003cbr\u003e\n[![Github Releases](https://img.shields.io/github/v/release/bitwizeshift/BackportCpp.svg?include_prereleases)](https://github.com/bitwizeshift/BackportCpp/releases)\n[![Bintray Releases](https://api.bintray.com/packages/bitwizeshift/public-conan/Backport%3Abackport/images/download.svg) ](https://bintray.com/bitwizeshift/public-conan/Backport%3Abackport/_latestVersion)\n\n------------------------------\n\n**Backport** is an ongoing effort to bring modern C++ utilities to be compatible\nwith C++11.\n\nIt is a header-only library that implements much of the functionality from\nC++14, C++17, and C++20 to be compatible with C++11. `constexpr` support is\nconditionally enabled based on the language setting of the compiler (e.g.\nif using C++14, more `constexpr` is available to the user than with C++11)\n\n## Table of Contents\n\n* [Rationale](#rationale) \\\n  A brief rational for while this library was created\n* [Features](#features) \\\n  A summary of all existing features in **Backport**\n* [FAQ](#faq) \\\n  Frequently asked questions about this library\n* [API Reference](https://bitwizeshift.github.io/BackportCpp/api/latest) \\\n  For doxygen-generated API information\n* [Legal](doc/legal.md) \\\n  Information about how to attribute this project\n* [How to install](doc/installing.md) \\\n  For a quick guide on how to install/use this in other projects\n* [Contributing Guidelines](.github/CONTRIBUTING.md) \\\n  Guidelines that must be followed in order to contribute to **Backport**\n\n## Rationale\n\nC++11 was release _9 years ago_, and yet many organizations still have yet to\nmove onto more modern releases. In some cases this is due to security reasons,\nin others it may be that the toolchains don't yet exist for more modern C++\nsupport. In any case, much of the newer C++ library types don't actually\nrequire newer C++ language features -- but provide significant value to the\ndeveloper by creating a new vocabulary that doesn't exist in prior versions.\n\nMuch of the newer utilities may also have parallels in Boost libraries,\nhowever many organizations are unable to adopt this -- either due to the domain\nbeing too constrained, or due to Boost being a large dependency to introduce.\n\nAs a result, this library exists as a standalone, **header-only**,\ndependency-free drop-in for newer standard library features from C++11, C++14,\nC++17, and C++20.\n\n## Features\n\n### C++20\n\n| Status | Feature                                                 | Paper(s)        |\n|--------|---------------------------------------------------------|-----------------|\n| ✅    | `bpstd::span`                                            | [`P0122R7`][01227]\u003cbr\u003e [`P1024R3`][10243]\u003cbr\u003e [`P1976R2`][19762]\u003cbr\u003e [`P0317R1`][03171] |\n| ✅    | `bpstd::to_address`                                      | [`P0653R2`][06532] |\n| ✅ (1) | `bpstd::make_unique_for_overwrite`                      | [`P1020R1`][10201]\u003cbr\u003e [`P1973R1`][19731] |\n| ✅     | `bpstd::is_nothrow_convertible`                         | [`P0758R1`][07581] |\n1. The papers also include `make_shared_for_overwrite` and `allocate_shared_for_overwrite`,\n   but these are intentionally not implemented -- since it is impossible to implement\n   efficiently without also authoring `shared_ptr` (since to join the node allocations\n   requires internal support)\n\n\u003c!-- span --\u003e\n[01227]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0122r7.pdf\n[10243]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1024r3.pdf\n[19762]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1976r2.html\n\u003c!-- to_address --\u003e\n[06532]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0653r2.html\n\u003c!-- make_unique_for_overwrite --\u003e\n[10201]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1020r1.html\n[19731]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1973r1.pdf\n\u003c!-- is_nothrow_convertible --\u003e\n[07581]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0758r1.html\n\n### C++17\n\n| Status | Feature                                                 | Paper(s)        |\n|--------|---------------------------------------------------------|-----------------|\n| ❌ (1) | File System                                            | [`P0218R1`][02181]\u003cbr\u003e [`P0219R1`][02191]\u003cbr\u003e [`P0392R0`][03920]\u003cbr\u003e [`P0317R1`][03171] |\n| ✅     | `bpstd::optional`                                     | [`N3793`][3793] |\n| ✅     | `bpstd::any`                                          | [`N3804`][3804] |\n| ✅     | `bpstd::string_view`                                  | [`N3921`][3921] |\n| ✅     |  uniform container access (non-member `size()`, `data()`, etc | [`N4280`][4280] |\n| ✅     | `bpstd::apply`                                        | [`N3915`][3915] |\n| ✅     | `bpstd::make_from_tuple`                              | [`P0209R2`][02092] |\n| ✅     | `bpstd::as_const`                                     | [`P0007R1`][00071] |\n| ✅     | `bpstd::variant`                                      | [`P0088R3`][00883]\u003cbr\u003e [`P0032R3`][00323]\u003cbr\u003e [`P0393R3`][03933] |\n| ✅     | `bpstd::uncaught_exceptions`                          | [`N4152`][4152]\u003cbr\u003e [`N4259`][4259] |\n| ✅     | `bpstd::byte`                                         | [`P0298R3`][02983] |\n| ✅     | `bpstd::not_fn`                                       | [`P0005R4`][00054] |\n| ✅     | `bpstd::invoke`                                       | [`N4169`][4169] |\n| ✅     | `bpstd::void_t`                                       | [`N3911`][3911] |\n| ✅     | `bpstd::bool_constant`                                | [`N4389`][4389] |\n| ✅     | Traits for swappability                               | [`P0185R1`][01851] |\n| 🚧     | Polymorphic allocators and memory resources           | [`N3916`](3916) |\n\n1. See [this answer](#where-is-stdfilesystem) in FAQ\n\n\u003c!-- file system --\u003e\n[02181]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0218r1.html\n[02191]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0219r1.html\n[03920]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0392r0.pdf\n[03171]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0317r1.html\n\u003c!-- optional --\u003e\n[3793]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3793.html\n\u003c!-- variant --\u003e\n[00883]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0088r3.html\n[00323]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf\n[03933]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0393r3.html\n\u003c!-- any --\u003e\n[3804]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3804.html\n\u003c!-- string_view --\u003e\n[3921]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3921.html\n\u003c!-- uniform container access --\u003e\n[4280]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4280.pdf\n\u003c!-- apply --\u003e\n[3915]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3915.pdf\n\u003c!-- make_from_tuple --\u003e\n[02092]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0209r2.pdf\n\u003c!-- as_const --\u003e\n[00071]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0007r1.html\n\u003c!-- uncaught_exceptions --\u003e\n[4152]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4152.pdf\n[4259]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4259.pdf\n\u003c!-- byte --\u003e\n[02983]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0298r3.pdf\n\u003c!-- not_fn --\u003e\n[00054]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0005r4.html\n\u003c!-- invoke --\u003e\n[4169]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4169.html\n\u003c!-- void_t --\u003e\n[3911]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3911.pdf\n\u003c!-- bool_constant --\u003e\n[4389]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4389.html\n\u003c!-- nothrow_swappable --\u003e\n[01851]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0185r1.html\n\u003c!-- Polymorphic Allocators --\u003e\n[N3916]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3916.pdf\n\n### C++14\n\n| Status | Feature                                                 | Paper(s)        |\n|--------|---------------------------------------------------------|-----------------|\n| ✅     | Type alias versions of standard transformation traits   | [`N3655`][3655] |\n| ✅     | Transparent operator functors (`bpstd::greater\u003c\u003e`, etc) | [`N3421`][3421] |\n| ✅     | `bpstd::tuple_element_t`                                | [`N3887`][3887] |\n| ❌ (1) | SFINAE-friendly `bpstd::result_of`                      | [`N3670`][3670] |\n| ✅     | Addressing tuples by type                               | [`N3462`][3462] |\n| ➖ (2) | `bpstd::is_final`                                       | [`LWG 2112`][39452112] |\n| ✅     | `bpstd::is_null_pointer`                                | [`LWG 2247`][38222247] |\n| ✅     | `bpstd::make_reverse_iterator`                          | [`LWG 2285`][39452285] |\n| ✅     | `bpstd::exchange`                                       | [`N3668`][3668] |\n| ✅     | `bpstd::make_unique`                                    | [`N3656`][3656] |\n| ✅     | Compile-time integer sequences (`bpstd::integer_sequence`) | [`N3658`][3658] |\n| ✅     | User-defined literals for standard library types (`bpstd::chrono_literals`, `bpstd::string_literals`) | [`N3642`][3642] |\n| ✅     | User-defined literals for `bpstd::complex` (`bpstd::complex_literals`) | [`N3779`][3779] |\n\n1. Obsolete. Replaced by `bpstd::invoke_result`\n2. Not implementable without compiler support. Pre-C++14, requires specializations\n   and will default to `false_type`\n\n\u003c!-- alias of transformation traits --\u003e\n[3655]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf\n\u003c!-- transparent operator functors --\u003e\n[3421]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3421.htm\n\u003c!-- tuple_element_t --\u003e\n[3887]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3887.pdf\n\u003c!-- sfinae-friendly result_of --\u003e\n[3670]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3670.html\n\u003c!-- addressing tuples by type --\u003e\n[3462]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3462.html\n\u003c!-- is_final --\u003e\n[39452112]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3945.html#2112\n\u003c!-- is_null_pointer --\u003e\n[38222247]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3822.html#2247\n\u003c!-- make_reverse_iterator --\u003e\n[39452285]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3945.html#2285\n\u003c!-- exchange --\u003e\n[3668]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3668.html\n\u003c!-- make_unique --\u003e\n[3656]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3656.htm\n\u003c!-- compile-time integer_sequence --\u003e\n[3658]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html\n\u003c!-- user defined literals for complex --\u003e\n[3779]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3779.pdf\n\u003c!-- user defined literals for chrono/string --\u003e\n[3642]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf\n\n## FAQ\n\n### Where is `std::filesystem`?\n\nThis library aims to deliver a _header-only_ solution to the many missing\ntypes that have been introduced in newer standard libraries. `std::filesystem`\nis a bit complicated to handle, since it introduces a dependency on the\noperating system being compiled against. Implementing `std::filesystem` will\ngenerally require conditional compilation, and -- for best practices --\nseparate source files in order to insulate use of system headers (lest this\nlibrary introduce the perils of the `\u003cwindows.h\u003e` macros). This would change the\nlibrary fundamentally so that it is no longer a header-only solution -- and this\nis not desirable.\n\nThird-party implementations of `std::filesystem` should exist, which can be\nindependently used.\n\n## Tested Compilers\n\nThis library has been tested against the following compilers / systems\n\n| Compiler         | Operating System                                          |\n|------------------|-----------------------------------------------------------|\n| gcc-4.9          | Ubuntu 18.04                                              |\n| gcc-5.0          | Ubuntu 18.04                                              |\n| gcc-6            | Ubuntu 18.04                                              |\n| gcc-7            | Ubuntu 18.04                                              |\n| gcc-8            | Ubuntu 18.04                                              |\n| gcc-9            | Ubuntu 18.04                                              |\n| clang-3.5        | ubuntu 18.04                                              |\n| clang-3.6        | ubuntu 18.04                                              |\n| clang-3.7        | ubuntu 18.04                                              |\n| clang-3.8        | ubuntu 18.04                                              |\n| clang-3.9        | ubuntu 18.04                                              |\n| clang-4.0        | ubuntu 18.04                                              |\n| clang-5.0        | ubuntu 18.04                                              |\n| clang-6.0        | ubuntu 18.04                                              |\n| clang-7          | ubuntu 18.04                                              |\n| clang-8          | ubuntu 18.04                                              |\n| clang-9          | ubuntu 18.04                                              |\n| xcode-11.0       | macOS 10 (latest)                                         |\n| xcode-11.3       | macOS 10 (latest)                                         |\n| MSVC-2015 (14.0) | Windows Server (latest)                                   |\n| MSVC-2017 (14.16)| Windows Server (latest)                                   |\n| MSVC-2019 (14.24)| Windows Server (latest)                                   |\n| clang-cl-9       | Windows Server (latest)                                   |\n| clang-9          | Windows Server (latest)                                   |\n| gcc-8.1          | Windows Server (latest)                                   |\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\n**Backport** is licensed under the\n[MIT License](http://opensource.org/licenses/MIT):\n\n\u003e Copyright \u0026copy; 2020 Matthew Rodusek\n\u003e\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy\n\u003e of this software and associated documentation files (the \"Software\"), to deal\n\u003e in the Software without restriction, including without limitation the rights\n\u003e to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\u003e copies of the Software, and to permit persons to whom the Software is\n\u003e furnished to do so, subject to the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be included in all\n\u003e copies or substantial portions of the Software.\n\u003e\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\u003e IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\u003e FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\u003e AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\u003e LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\u003e OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\u003e SOFTWARE.\n","funding_links":["https://github.com/sponsors/bitwizeshift","https://patreon.com/bitwizeshift","https://www.buymeacoffee.com/dsq3XCcBE"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwizeshift%2Fbackportcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitwizeshift%2Fbackportcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitwizeshift%2Fbackportcpp/lists"}