{"id":18508094,"url":"https://github.com/soasis/out_ptr","last_synced_at":"2025-04-09T03:31:48.056Z","repository":{"id":37402488,"uuid":"185273550","full_name":"soasis/out_ptr","owner":"soasis","description":"Repository for a C++11 implementation of std::out_ptr (p1132), as a standalone library!","archived":false,"fork":false,"pushed_at":"2025-04-07T00:40:19.000Z","size":1032,"stargazers_count":75,"open_issues_count":0,"forks_count":3,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-07T01:28:00.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://thephd.github.io/_vendor/future_cxx/papers/d1132.html","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/soasis.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-06T21:19:38.000Z","updated_at":"2025-04-07T00:40:23.000Z","dependencies_parsed_at":"2024-01-03T05:24:58.106Z","dependency_job_id":"9a64864f-3d22-4d77-a7e1-51f4dbf9b8ea","html_url":"https://github.com/soasis/out_ptr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soasis%2Fout_ptr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soasis%2Fout_ptr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soasis%2Fout_ptr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soasis%2Fout_ptr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soasis","download_url":"https://codeload.github.com/soasis/out_ptr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247973714,"owners_count":21026721,"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":[],"created_at":"2024-11-06T15:13:22.066Z","updated_at":"2025-04-09T03:31:47.626Z","avatar_url":"https://github.com/soasis.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ztd.out_ptr\r\n\r\n`ztd.out_ptr` is a simple parameter wrapper for output pointers.\r\n\r\n[![Linux \u0026 Max OSX Build Status](https://travis-ci.org/ThePhD/out_ptr.svg?branch=master)](https://travis-ci.org/ThePhD/out_ptr)\r\n[![Build status](https://ci.appveyor.com/api/projects/status/aj895ac668xa8jo0?svg=true)](https://ci.appveyor.com/project/ThePhD/out-ptr)\r\n\r\n\r\n# Quick Comparison and Example\r\n\r\n```cpp\r\n// Before\r\nstd::unique_ptr\u003cObj, ObjDeleter\u003e ptr;\r\n\r\nif (T* tmp_ptr; !c_api_get_obj(\u0026tmp_ptr, ...)) {\r\n  throw std::runtime_error(...);\r\n}\r\nelse {\r\n  ptr.reset(tmp_ptr);\r\n}\r\n\r\nuse(ptr);\r\n```\r\n\r\n```cpp\r\n// After\r\nnamespace zop = ztd::out_ptr;\r\nstd::unique_ptr\u003cObj, ObjDeleter\u003e ptr;\r\n\r\nif (!c_api_get_obj(zop::inout_ptr(ptr), ...)) {\r\n  throw std::runtime_error(...);\r\n}\r\n\r\nuse(ptr);\r\n```\r\n\r\n\r\n# Full Examples and Documentation\r\n\r\nThere are examples and documentation contained in this repository: please, peruse them as much as you need to! Some interesting/illuminating ones:\r\n\r\n- It works with [custom unique pointers just fine](examples/source/std.custom_unique_ptr.cpp)\r\n- It is [customizable to your own pointer types](examples/source/custom.handle.cpp), if you need performance or different semantics\r\n- It works with [Boost](examples/source/boost.shared_ptr.cpp) and [Standard](examples/source/std.shared_ptr.cpp) shared pointers.\r\n- It works with things like [unique_resource](https://github.com/okdshin/unique_resource) out of the box.\r\n\r\n\r\n# Running Tests\r\n\r\nRight now, can be run easily VIA CMake. To ease development, all necessary dependencies -- including other Boost dependencies -- are included as submodules. You can initialize and update all submodules by performing a successful `git submodule update --init --recursive` call.\r\n\r\nFrom there, CMake is run. It requires that the parameters `ZTD_OUT_PTR_TESTS` is `ON`. Examples can also be run by specifying `ZTD_OUT_PTR_EXAMPLES` and `ZTD_OUT_PTR_TESTS` to be `ON` at the same time:\r\n\r\n```bash\r\nmd out_ptr-build\r\ncd out_ptr-build\r\ncmake path/to/out_ptr/src -GNinja -DZTD_OUT_PTR_TESTS=ON -DZTD_OUT_PTR_EXAMPLES=ON\r\ncmake --build .\r\nctest --output-on-failure\r\n```\r\n\r\nYou can replace the `-G` argument with the generator of your choice. You may also add the `-DCMAKE_BUILD_TYPE=Debug|Release` to test certain build types. If you do, make sure to specify it on the build and test lines as well with `cmake --build . --config Debug|Release` and `ctest --output-on-failure --build-config=Debug|Release`.\r\n\r\n\r\n# Running Benchmarks\r\n\r\nBenchmarks can be run by running CMake with the option `-DZTD_OUT_PTR_BENCHMARKS` set to `ON`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoasis%2Fout_ptr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoasis%2Fout_ptr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoasis%2Fout_ptr/lists"}