{"id":26368782,"url":"https://github.com/bindreams/prindex","last_synced_at":"2025-07-27T14:09:07.502Z","repository":{"id":167685068,"uuid":"100793299","full_name":"bindreams/prindex","owner":"bindreams","description":"Modification of RTTI for more convinient usage.","archived":false,"fork":false,"pushed_at":"2025-03-07T14:54:10.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-16T22:48:58.773Z","etag":null,"topics":[],"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/bindreams.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}},"created_at":"2017-08-19T12:37:19.000Z","updated_at":"2025-03-07T14:45:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa270cac-ed42-47a7-8dd8-ecdd5afcb297","html_url":"https://github.com/bindreams/prindex","commit_stats":null,"previous_names":["andreasxp/prindex","bindreams/prindex"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bindreams/prindex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Fprindex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Fprindex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Fprindex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Fprindex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bindreams","download_url":"https://codeload.github.com/bindreams/prindex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Fprindex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267368932,"owners_count":24076093,"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-07-27T02:00:11.917Z","response_time":82,"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":[],"created_at":"2025-03-16T22:49:00.834Z","updated_at":"2025-07-27T14:09:07.481Z","avatar_url":"https://github.com/bindreams.png","language":"C++","readme":"# prindex\nA simple, lightweight wrapper around C++'s `type_info` for consistent, cross-compiler usage.\n\nGet the same `name()` and `hash_code()` on every (supported) compiler and standard library.\n## Installation\nPrindex is a single-header library. You can download the latest release [here](https://github.com/andreasxp/prindex/releases).\nUsing prindex requires support of C++11.\n## Usage\nPrindex was designed to be as similar in usage as `type_info` and `type_index`. Here is a table of different uses and their alternatives in prindex:\n\n| C++ Standard                                    | prindex                                         |\n| ----------------------------------------------- | ----------------------------------------------- |\n| `typeid(type)`                                  | `zh::prid\u003ctype\u003e() or PRID(type)`                |\n| `typeid(expr)`                                  | `zh::prid(expr) or PRID(expr)`                  |\n| `const std::type_info\u0026 ti = typeid(...)`        | `const zh::prinfo\u0026 ti = PRID(...)`              |\n| `std::type_index(typeid(...))`                  | `zh::prindex(zh::prid(...))` or `PRIDX(...)`    |\n\nIf you would like to take advantage of the *true keyword experience*, prindex includes helpful macros, so you can use `PRID(type)` instead of `zh::prid\u003ctype\u003e()` (same for `pridx`).\n\nAll interfaces of included classes are identical to the corresponding ones in the C++ Standard.\n## Documentation\nAll classes and functions described are in `namespace zh`.\n### `class prinfo`\nThe class `prinfo` holds implementation-independent information about a type, including the name of the type and means to compare two types for equality or collating order. This is the class returned by the `prid` operator.\n\nThe `prinfo` class is neither CopyConstructible nor CopyAssignable.\n#### Member functions\n* (constructor) [deleted]  \nhas neither default nor copy constructors\n* (destructor) [virtual]  \nderived objects are safe to delete through pointer-to-base \n* `operator=` [deleted]  \ncan not be copy-assigned \n* `operator==`\n* `operator!=`  \nchecks whether the objects refer to the same type \n* `before`  \nchecks whether the referred type precedes referred type of another `prinfo` object in the implementation defined order, i.e. orders the referred types \n* `hash_code`  \nreturns a value which is identical for the same types \n* `name`  \nimplementation-independent name of the type\n\n### `class prindex`\nThe `prindex` class is a wrapper class around a `prinfo` object, that can be used as index in associative and unordered associative containers. The relationship with `prinfo` object is maintained through a pointer, therefore `prindex` is CopyConstructible and CopyAssignable.\n\n#### Member functions\n* (constructor)  \nconstructs the object  \n* (destructor)  \ndestroys the prindex object\n* `operator=`  \nassigns a prindex object\n* `operator==`\n* `operator!=`\n* `operator\u003c`\n* `operator\u003c=`\n* `operator\u003e`\n* `operator\u003e=`  \ncompares the underlying `prinfo` objects\n* `hash_code`  \nreturns hashed code \n* `name`  \nreturns implementation-independent name of the type,\nassociated with underlying `prinfo` object \n\n#### Helper classes\n`std::hash\u003cprindex\u003e`  \nhash support for `prindex`\n\n### Function/macro `prid`\n```C++\ntemplate \u003cclass T\u003e\ninline const prinfo\u0026 prid();\n\ntemplate \u003cclass T\u003e\ninline const prinfo\u0026 prid(T\u0026\u0026 obj);\n```\n```C++\n#define PRID(...) \\\nzh::detail::get_prinfo(typeid(__VA_ARGS__))\n```\nThe `prid` function returns a const reference to a `prid` object, holding implementation-independent information about a type or expression passed into it. `PRID` is a macro that does the same thing.\n\n### Function/macro `pridx`\n```C++\ntemplate \u003cclass T\u003e\ninline prindex pridx();\n\ntemplate \u003cclass T\u003e\ninline prindex pridx(T\u0026\u0026 obj);\n```\n```C++\n#define PRIDX(...) \\\nzh::prindex(zh::detail::get_prinfo(typeid(__VA_ARGS__)))\n```\nThe `pridx` function returns a `prindex` object, holding implementation-independent information about a type or expression passed into it. `PRIDX` is a macro that does the same thing.\n\n## License\nThis project is licenced under the MIT licence. It is free for personal and commercial use.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbindreams%2Fprindex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbindreams%2Fprindex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbindreams%2Fprindex/lists"}