{"id":13419372,"url":"https://github.com/mpark/variant","last_synced_at":"2025-10-11T04:58:06.585Z","repository":{"id":32613816,"uuid":"36199189","full_name":"mpark/variant","owner":"mpark","description":"C++17 `std::variant` for C++11/14/17","archived":false,"fork":false,"pushed_at":"2022-12-07T10:28:31.000Z","size":35483,"stargazers_count":691,"open_issues_count":10,"forks_count":91,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-24T05:03:24.801Z","etag":null,"topics":["cpp","cpp11","cpp14","cpp17","cpp20","discriminated-unions","polymorphism","variant"],"latest_commit_sha":null,"homepage":"https://mpark.github.io/variant","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"AlloVince/EvaOAuth","license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-24T23:29:39.000Z","updated_at":"2025-05-14T11:56:58.000Z","dependencies_parsed_at":"2023-01-14T21:44:07.312Z","dependency_job_id":null,"html_url":"https://github.com/mpark/variant","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mpark/variant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpark%2Fvariant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpark%2Fvariant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpark%2Fvariant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpark%2Fvariant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpark","download_url":"https://codeload.github.com/mpark/variant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpark%2Fvariant/sbom","scorecard":{"id":662607,"data":{"date":"2025-08-11","repo":{"name":"github.com/mpark/variant","commit":"23cb94f027d4ef33bf48133acc2695c7e5c6f1e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 6/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: Boost Software License 1.0: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.4.0 not signed: https://api.github.com/repos/mpark/variant/releases/14875036","Warn: release artifact v1.3.0 not signed: https://api.github.com/repos/mpark/variant/releases/8862704","Warn: release artifact v1.2.2 not signed: https://api.github.com/repos/mpark/variant/releases/7745261","Warn: release artifact v1.2.1 not signed: https://api.github.com/repos/mpark/variant/releases/6686942","Warn: release artifact v1.2.0 not signed: https://api.github.com/repos/mpark/variant/releases/6495033","Warn: release artifact v1.4.0 does not have provenance: https://api.github.com/repos/mpark/variant/releases/14875036","Warn: release artifact v1.3.0 does not have provenance: https://api.github.com/repos/mpark/variant/releases/8862704","Warn: release artifact v1.2.2 does not have provenance: https://api.github.com/repos/mpark/variant/releases/7745261","Warn: release artifact v1.2.1 does not have provenance: https://api.github.com/repos/mpark/variant/releases/6686942","Warn: release artifact v1.2.0 does not have provenance: https://api.github.com/repos/mpark/variant/releases/6495033"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T16:38:42.501Z","repository_id":32613816,"created_at":"2025-08-21T16:38:42.501Z","updated_at":"2025-08-21T16:38:42.501Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006219,"owners_count":26084063,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","cpp11","cpp14","cpp17","cpp20","discriminated-unions","polymorphism","variant"],"created_at":"2024-07-30T22:01:15.026Z","updated_at":"2025-10-11T04:58:06.568Z","avatar_url":"https://github.com/mpark.png","language":"C++","readme":"# MPark.Variant\n\n\u003e __C++17__ `std::variant` for __C++11__/__14__/__17__\n\n[![release][badge.release]][release]\n[![header][badge.header]][header]\n[![travis][badge.travis]][travis]\n[![appveyor][badge.appveyor]][appveyor]\n[![license][badge.license]][license]\n[![godbolt][badge.godbolt]][godbolt]\n[![wandbox][badge.wandbox]][wandbox]\n\n[badge.release]: https://img.shields.io/github/release/mpark/variant.svg\n[badge.header]: https://img.shields.io/badge/single%20header-master-blue.svg\n[badge.travis]: https://travis-ci.org/mpark/variant.svg?branch=master\n[badge.appveyor]: https://ci.appveyor.com/api/projects/status/github/mpark/variant?branch=master\u0026svg=true\n[badge.license]: https://img.shields.io/badge/license-boost-blue.svg\n[badge.godbolt]: https://img.shields.io/badge/try%20it-on%20godbolt-222266.svg\n[badge.wandbox]: https://img.shields.io/badge/try%20it-on%20wandbox-5cb85c.svg\n\n[release]: https://github.com/mpark/variant/releases/latest\n[header]: https://github.com/mpark/variant/blob/single-header/master/variant.hpp\n[travis]: https://travis-ci.org/mpark/variant\n[appveyor]: https://ci.appveyor.com/project/mpark/variant\n[license]: https://github.com/mpark/variant/blob/master/LICENSE.md\n[godbolt]: https://godbolt.org/z/4r7hEy\n[wandbox]: https://wandbox.org/permlink/dTZxf85MVhehOqx1\n\n## Introduction\n\n__MPark.Variant__ is an implementation of __C++17__ `std::variant` for __C++11__/__14__/__17__.\n\n  - Based on [my implementation of `std::variant` for __libc++__][libcxx-impl]\n  - Continuously tested against __libc++__'s `std::variant` test suite.\n\n[libcxx-impl]: https://reviews.llvm.org/rL288547\n\n## Documentation\n\n  - [cppreference.com](http://en.cppreference.com/w/cpp/utility/variant)\n  - [eel.is/c++draft](http://eel.is/c++draft/variant)\n\n## Integration\n\n### Single Header\n\nThe [single-header] branch provides a standalone `variant.hpp`\nfile for each [release](https://github.com/mpark/variant/releases).\nCopy it and `#include` away!\n\n[single-header]: https://github.com/mpark/variant/tree/single-header\n\n### Submodule\n\nYou can add `mpark/variant` as a submodule to your project.\n\n```bash\ngit submodule add https://github.com/mpark/variant.git 3rdparty/variant\n```\n\nAdd the `include` directory to your include path with\n`-I3rdparty/variant/include` then `#include` the `variant.hpp` header\nwith `#include \u003cmpark/variant.hpp\u003e`.\n\nIf you use CMake, you can simply use `add_subdirectory(3rdparty/variant)`:\n\n```cmake\ncmake_minimum_required(VERSION 3.6.3)\n\nproject(HelloWorld CXX)\n\nadd_subdirectory(3rdparty/variant)\n\nadd_executable(hello-world hello_world.cpp)\ntarget_link_libraries(hello-world mpark_variant)\n```\n\n### Installation / CMake `find_package`\n\n```bash\ngit clone https://github.com/mpark/variant.git\nmkdir variant/build \u0026\u0026 cd variant/build\ncmake ..\ncmake --build . --target install\n```\n\nThis will install `mpark/variant` to the default install-directory for\nyour platform (`/usr/local` for Unix, `C:\\Program Files` for Windows).\nYou can also install at a custom location via the `CMAKE_INSTALL_PREFIX`\nvariable, (e.g., `cmake .. -DCMAKE_INSTALL_PREFIX=/opt`).\n\nThe installed `mpark/variant` can then be found by CMake via `find_package`:\n\n```cmake\ncmake_minimum_required(VERSION 3.6.3)\n\nproject(HelloWorld CXX)\n\nfind_package(mpark_variant 1.3.0 REQUIRED)\n\nadd_executable(hello-world hello_world.cpp)\ntarget_link_libraries(hello-world mpark_variant)\n```\n\nCMake will search for `mpark/variant` in its default set of\ninstallation prefixes. If `mpark/variant` is installed in\na custom location via the `CMAKE_INSTALL_PREFIX` variable,\nyou'll likely need to use the `CMAKE_PREFIX_PATH` to specify\nthe location (e.g., `cmake .. -DCMAKE_PREFIX_PATH=/opt`).\n\n## Requirements\n\nThis library requires a standard conformant __C++11__ compiler.\nThe following compilers are continously tested:\n\n| Compiler                               | Operating System                            | Version String                                                                     |\n| -------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------- |\n| GCC 4.8.5                              | Ubuntu 16.04.6 LTS                          | g++-4.8 (Ubuntu 4.8.5-4ubuntu8~16.04.1) 4.8.5                                      |\n| GCC 4.9.4                              | Ubuntu 16.04.6 LTS                          | g++-4.9 (Ubuntu 4.9.4-2ubuntu1~16.04) 4.9.4                                        |\n| GCC 5.5.0                              | Ubuntu 16.04.6 LTS                          | g++-5 (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010                                |\n| GCC 6.5.0                              | Ubuntu 16.04.6 LTS                          | g++-6 (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026                                 |\n| GCC 7.4.0                              | Ubuntu 16.04.6 LTS                          | g++-7 (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0                                     |\n| GCC 8.3.0                              | Ubuntu 16.04.6 LTS                          | g++-8 (Ubuntu 8.3.0-16ubuntu3~16.04) 8.3.0                                         |\n| GCC 9.2.1                              | Ubuntu 16.04.6 LTS                          | g++-9 (Ubuntu 9.2.1-17ubuntu1~16.04) 9.2.1 20191102                                |\n| Clang 3.6.2                            | Ubuntu 16.04.6 LTS                          | Ubuntu clang version 3.6.2-3ubuntu2 (tags/RELEASE_362/final) (based on LLVM 3.6.2) |\n| Clang 3.7.1                            | Ubuntu 16.04.6 LTS                          | Ubuntu clang version 3.7.1-2ubuntu2 (tags/RELEASE_371/final) (based on LLVM 3.7.1) |\n| Clang 3.8.0                            | Ubuntu 16.04.6 LTS                          | clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)                              |\n| Clang 3.9.1                            | Ubuntu 16.04.6 LTS                          | clang version 3.9.1-4ubuntu3~16.04.2 (tags/RELEASE_391/rc2)                        |\n| Clang 4.0.0                            | Ubuntu 16.04.6 LTS                          | clang version 4.0.0-1ubuntu1~16.04.2 (tags/RELEASE_400/rc1)                        |\n| Clang 5.0.0                            | Ubuntu 16.04.6 LTS                          | clang version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)                             |\n| Clang 6.0.0                            | Ubuntu 16.04.6 LTS                          | clang version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)                      |\n| Clang 7.1.0                            | Ubuntu 16.04.6 LTS                          | clang version 7.1.0-svn353565-1~exp1~20190408084827.60 (branches/release_70)       |\n| Clang 8.0.1                            | Ubuntu 16.04.6 LTS                          | clang version 8.0.1-svn369350-1~exp1~20190820122438.78 (branches/release_80)       |\n| Clang Xcode 8.3                        | Darwin Kernel Version 16.7.0 (OS X 10.12.6) | Apple LLVM version 8.1.0 (clang-802.0.42)                                          |\n| Clang Xcode 9.4                        | Darwin Kernel Version 17.4.0 (OS X 10.13.3) | Apple LLVM version 9.1.0 (clang-902.0.39.2)                                        |\n| Clang Xcode 10.1                       | Darwin Kernel Version 17.7.0 (OS X 10.13.6) | Apple LLVM version 10.0.0 (clang-1000.11.45.5)                                     |\n| Visual Studio 14 2015                  | Visual Studio 2015 with Update 3            | MSVC 19.0.24241.7                                                                  |\n| Visual Studio 15 2017                  | Visual Studio 2017 with Update 8            | MSVC 19.15.26732.1                                                                 |\n| Visual Studio 15 2017                  | Visual Studio 2017 with Update 9            | MSVC 19.16.27025.1                                                                 |\n| Visual Studio 15 2017 (__Clang/LLVM__) | Visual Studio 2017                          | Clang 7.0.0                                                                        |\n\n#### NOTES\n  - __GCC 4.8__/__4.9__: `constexpr` support is not available for `visit` and relational operators.\n  - Enabling __libc++__ `std::variant` tests require `-std=c++17` support.\n\n## CMake Variables\n\n  -  __`MPARK_VARIANT_INCLUDE_TESTS`__:`STRING` (__default__: `\"\"`)\n\n     Semicolon-separated list of tests to build.\n     Possible values are `mpark`, and `libc++`.\n\n     __NOTE__: The __libc++__ `std::variant` tests are built with `-std=c++17`.\n\n## Unit Tests\n\nRefer to [test/README.md](test/README.md).\n\n## License\n\nDistributed under the [Boost Software License, Version 1.0](LICENSE.md).\n","funding_links":[],"categories":["TODO scan for Android support in followings","Miscellaneous","Recently Updated","C++"],"sub_categories":["[Who Wants to Be a Millionare](https://www.boardgamecapital.com/who-wants-to-be-a-millionaire-rules.htm)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpark%2Fvariant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpark%2Fvariant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpark%2Fvariant/lists"}