{"id":18223068,"url":"https://github.com/ostanton/diabolicaldelegates","last_synced_at":"2025-04-08T01:42:47.269Z","repository":{"id":250804657,"uuid":"835526483","full_name":"ostanton/DiabolicalDelegates","owner":"ostanton","description":"Single-file C++23 Delegates and Events","archived":false,"fork":false,"pushed_at":"2025-01-05T18:42:32.000Z","size":1878,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T01:42:42.898Z","etag":null,"topics":["cmake","cpp-modules","cpp20","cpp23","delegate","delegates","events","interface","modern-cpp"],"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/ostanton.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":"2024-07-30T02:50:45.000Z","updated_at":"2025-01-05T18:42:35.000Z","dependencies_parsed_at":"2024-07-30T07:01:58.721Z","dependency_job_id":"e178f13b-8484-417e-b6cd-e445d6946741","html_url":"https://github.com/ostanton/DiabolicalDelegates","commit_stats":null,"previous_names":["ostanton/diabolicaldelegates"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostanton%2FDiabolicalDelegates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostanton%2FDiabolicalDelegates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostanton%2FDiabolicalDelegates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostanton%2FDiabolicalDelegates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ostanton","download_url":"https://codeload.github.com/ostanton/DiabolicalDelegates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761039,"owners_count":20991533,"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":["cmake","cpp-modules","cpp20","cpp23","delegate","delegates","events","interface","modern-cpp"],"created_at":"2024-11-04T00:04:03.269Z","updated_at":"2025-04-08T01:42:47.251Z","avatar_url":"https://github.com/ostanton.png","language":"C++","readme":"# Diabolical Delegates\n\nA diabolical approach to delegates and events in C++. Uses C++20's modules, and C++23's modularised standard library.\n\n## Dependencies\n\nNone. Except C++23.\n\n## How to include\n\nCopy \u0026 paste the `diabolical_delegates.cpp` file wherever, then `import` the module.\n\n## How to use\n\nThere are currently 5 classes:\n- Delegate\n- MemberDelegate\n- FunctorDelegate\n- Event\n- MultiEvent\n\n`Delegate`s and `Event`s have return values and variadic template parameters.\nThese are what define the signatures of the functions that can be bound to them.\n\n### Delegate\n\nA delegate is simply a wrapper for any kind of function, implemented in its derived classes.\n\n### MemberDelegate\n\nA subclass of `Delegate`, it implements member functions with their object context.\n\n### FunctorDelegate\n\nA subclass of `Delegate`, it implements free-floating/global functions via a simple function pointer.\n\n### Event\n\nA wrapper for a delegate of any kind. It can be bound and unbound, supports whatever subclasses of `Delegate` there are.\n\n### MultiEvent\n\nAnother version of `Event` which supports any number of `Delegate`s, not just one. These are `add`ed instead of `bind`ed.\nSince `MultiEvent`s can have any number of `Delegate`s, their `broadcast` function is split into two. One executes all\nthe delegates without returning anything, and the other takes in a function to put the return value of each delegate execution\ninto.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"billy-butcher-diabolical.gif\"\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostanton%2Fdiabolicaldelegates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fostanton%2Fdiabolicaldelegates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostanton%2Fdiabolicaldelegates/lists"}