{"id":16692898,"url":"https://github.com/seleznevae/owi_optional","last_synced_at":"2025-07-10T07:05:43.635Z","repository":{"id":93769078,"uuid":"329074318","full_name":"seleznevae/owi_optional","owner":"seleznevae","description":"standard c++ std::optional with iterators","archived":false,"fork":false,"pushed_at":"2021-02-02T18:46:06.000Z","size":134,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T22:42:59.078Z","etag":null,"topics":["cpp","cpp17","iterators","optional"],"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/seleznevae.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":"2021-01-12T18:19:07.000Z","updated_at":"2023-12-25T09:53:02.000Z","dependencies_parsed_at":"2023-03-02T17:30:31.364Z","dependency_job_id":null,"html_url":"https://github.com/seleznevae/owi_optional","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seleznevae/owi_optional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleznevae%2Fowi_optional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleznevae%2Fowi_optional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleznevae%2Fowi_optional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleznevae%2Fowi_optional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seleznevae","download_url":"https://codeload.github.com/seleznevae/owi_optional/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleznevae%2Fowi_optional/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545018,"owners_count":23625387,"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":["cpp","cpp17","iterators","optional"],"created_at":"2024-10-12T16:28:46.403Z","updated_at":"2025-07-10T07:05:43.619Z","avatar_url":"https://github.com/seleznevae.png","language":"C++","readme":"# owi_optional - standard c++ std::optional with iterators\n\n[![Build Status](https://travis-ci.com/seleznevae/owi_optional.svg?branch=master)](https://travis-ci.com/seleznevae/owi_optional)\n\n## Motivation\n\nEnable usage of `optional` in contexts where containers can be used (in range-based for loop, in standard algorithms, generic template functions that receive iterators or range as arguments).\n\n### Basic example\n\n```C++\n#include \u003ciostream\u003e\n#include \u003cnumeric\u003e\n\n#include \"owi/optional.hpp\"\n\nint main(void)\n{\n    owi::optional\u003cint\u003e opt{42};\n    owi::optional\u003cint\u003e empty;\n\n    std::cout \u003c\u003c \"====   RANGE-BASED FOR LOOP  ====\\n\";\n    for (int i : opt)\n        std::cout \u003c\u003c i \u003c\u003c std::endl;\n\n    std::cout \u003c\u003c \"\\n====   RANGE-BASED FOR LOOP for empty optional  ====\\n\";\n    for (int i : empty)\n        std::cout \u003c\u003c i \u003c\u003c std::endl;\n\n    std::cout \u003c\u003c \"\\n====   Standard algorigms with optional  ====\\n\";\n    std::cout \u003c\u003c \"Sum of elements: \" \u003c\u003c std::accumulate(opt.cbegin(), opt.cend(), 0) \u003c\u003c std::endl;\n}\n```\n\nOutput:\n```text\n====   RANGE-BASED FOR LOOP  ====\n42\n\n====   RANGE-BASED FOR LOOP for empty optional  ====\n\n====   Standard algorigms with optional  ====\nSum of elements: 42\n```\n\n## License\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; 2021 Seleznev Anton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseleznevae%2Fowi_optional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseleznevae%2Fowi_optional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseleznevae%2Fowi_optional/lists"}