{"id":49571595,"url":"https://github.com/unrays/exotic-crtp","last_synced_at":"2026-05-03T14:33:21.669Z","repository":{"id":346154860,"uuid":"1182756602","full_name":"unrays/exotic-crtp","owner":"unrays","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-22T14:08:44.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-23T05:35:13.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unrays.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T23:25:12.000Z","updated_at":"2026-03-22T14:08:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/unrays/exotic-crtp","commit_stats":null,"previous_names":["unrays/exotic-crtp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/unrays/exotic-crtp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrays%2Fexotic-crtp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrays%2Fexotic-crtp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrays%2Fexotic-crtp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrays%2Fexotic-crtp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unrays","download_url":"https://codeload.github.com/unrays/exotic-crtp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unrays%2Fexotic-crtp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32573322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-05-03T14:33:20.972Z","updated_at":"2026-05-03T14:33:21.659Z","avatar_url":"https://github.com/unrays.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# exotic-crtp\n\n**Article :** [Rethinking Static Polymorphism with C++23](https://medium.com/@felixolivierdumas/exotic-crtp-rethinking-static-polymorphism-with-c-23-89f9e75e8ffd)\n\n## The pattern\n\n```cpp\nnamespace exotic {\n\n    template\u003ctypename... From\u003e\n    struct crtp_access : From... {};\n\n    template\u003ctypename T\u003e\n    constexpr decltype(auto) as_crtp(T\u0026\u0026 obj) noexcept {\n        using crtp_access_t = crtp_access\u003cstd::remove_cvref_t\u003cT\u003e\u003e;\n        return static_cast\u003ccrtp_access_t\u0026\u0026\u003e(obj);\n    }\n\n}\n\nstruct Base {\n    void interface(this auto\u0026\u0026 self) {\n        return as_crtp(self).implementation();\n    }\n};\n\nstruct Derived : Base {\n    void implementation(this crtp_access\u003cDerived\u003e self) {\n        std::cout \u003c\u003c \"Derived implementation\" \u003c\u003c std::endl;\n    }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funrays%2Fexotic-crtp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funrays%2Fexotic-crtp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funrays%2Fexotic-crtp/lists"}