{"id":19168456,"url":"https://github.com/bloomberg/p1160","last_synced_at":"2025-10-11T08:08:37.782Z","repository":{"id":66125197,"uuid":"154174379","full_name":"bloomberg/p1160","owner":"bloomberg","description":"P1160 Add Test Polymorphic Memory Resource To Standard Library","archived":false,"fork":false,"pushed_at":"2024-10-03T12:32:19.000Z","size":163,"stargazers_count":38,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-15T03:54:20.253Z","etag":null,"topics":["cpp17","wg21"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bloomberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"supportlib/CMakeLists.txt","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T16:08:12.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"25be2032-551d-4345-97e0-e819d669e78a","html_url":"https://github.com/bloomberg/p1160","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp1160","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp1160/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp1160/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2Fp1160/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloomberg","download_url":"https://codeload.github.com/bloomberg/p1160/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003954,"owners_count":21196794,"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":["cpp17","wg21"],"created_at":"2024-11-09T09:42:44.827Z","updated_at":"2025-10-11T08:08:32.728Z","avatar_url":"https://github.com/bloomberg.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purpose\n\nCode in this repository is for demonstration purposes only.  It is not meant to be used as-is in for any other purpose than being able to follow the WG21 ISO C++ Standard Library proposal paper P1160, or its accompanying presentations available on YouTube.\n\nSince this code places the proposed names into the `std::pmr` namespace while it is *not* part of the \"implementation\" (what ships with the compiler) it, technically, is undefined behavior.\n\nThe code and the simple \"build system\" worked with compilers and standard libraries at the time of the proposal, but it is not maintained as the proposal could not go forward.\n\nThe code itself was a first introduction into the idea, not what a modern, or postmodern C++ library component should look like.  The paper discusses this, and notes that the \"API\" should be rethinked in light of all the new core language and library features.\n\n# P1160 Add Test Polymorphic Memory Resource To The Standard Library\n\nThis repository contains the source code and build system for an example implementation of a `std::pmr` compatible polymorphic memory resource, intended for use in instrumented tests. The paper which describes the motivation, operation, and other aspects of this code can be found in the [WG21 paper repository](http://wg21.link/p1160 \"P1160R0\").\n\n# Prerequisites\n\n * CMake\n * MSVC 2017 or gcc-9 \n\nAt the time of writing the Microsoft Visual Studio 2017 and gcc-9 (trunk) are the only compilers that implement `std::pmr` as specified in the C++17 specification, so those are the only to toolchains that have been tested (it's likely to compatible with more recent versions of those compilers)\n\nThe most relevant instructions for installing gcc (at the time of writing, 2019.Apr.20): See https://gcc.gnu.org/wiki/InstallingGCC and replace gcc-4.6.0.tar.gz with a snapshot such as https://gcc.gnu.org/pub/gcc/snapshots/LATEST-9/\n\nlibc++ (i.e. the native library for clang) does not yet have a standard `pmr` implementation.  I was able to compile the code in this repository using `\u003cexperimental/memory_resource\u003e` that libc++ implements currently (May 2019).\n\n# Recorded Presentations\n\n## CppCon 2019, Aurora, CO\nWatch this video first, it is shorter and more enjoyable.\n[![CppCon 2019, Aurora, CO](https://img.youtube.com/vi/vijveMT2OCY/maxresdefault.jpg)](https://youtu.be/vijveMT2OCY)\n## C++ Now 2019, Aspen, CO\n[![C++ Now 2019, Aspen, CO](https://img.youtube.com/vi/48oAZqlyx_g/maxresdefault.jpg)](https://youtu.be/48oAZqlyx_g)\n\n# How to Understand the Code\n\nThe repository consists of 5 major parts:\n\n  * supportlib -- macros and printing helpers (static lib)\n  * stdpmr -- the implementations of the proposed types and the exception testing algorithm (static lib)\n  * pstring -- a series of examples of testing and fixing an imaginary (and quite pathological) string class (executables)\n  * exception_testing -- an example using the `exception_test_loop`\n  * patchpmr -- hacks to make clang with libc++ and older GNU libraries with experimental support work\n\nPlease read the paper, or watch the presentation, to better understand the repository contents.\n\n# Versions of this Repository\n\nPlease use the `master` branch of this repository *unless* you are following a presentation from a conference, or for a specific paper revision, in which case I suggest checking out the corresponding tag.\n\n# Versioning\n\nGit tag: R0 -- Corresponds to the paper revision P1160R0\n\nGit tag: CppNow2019 -- added gcc support, reorganized the code, switched to cmake\n\nGit tag: CppCon2019 -- fixed handling of 0 sized allocations to the standard way (allocating and not returning 0)\n\n# Troubleshooting\n\nIf you find any issue or have any concerns please do not hesitate to open an [issue](../../issues).\n\nPull requests are welcome, however since this code accompanies a paper, changes that would change the essence of\nthe proposal would be better be addressed during WG21 discussions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fp1160","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloomberg%2Fp1160","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fp1160/lists"}