{"id":21654813,"url":"https://github.com/localvoid/cxx-rock","last_synced_at":"2025-03-20T04:42:34.004Z","repository":{"id":6304473,"uuid":"7539208","full_name":"localvoid/cxx-rock","owner":"localvoid","description":"C++ library","archived":false,"fork":false,"pushed_at":"2013-02-06T01:05:27.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T06:25:24.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/localvoid.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-10T10:44:21.000Z","updated_at":"2013-02-20T04:28:59.000Z","dependencies_parsed_at":"2022-08-29T18:52:13.510Z","dependency_job_id":null,"html_url":"https://github.com/localvoid/cxx-rock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fcxx-rock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fcxx-rock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fcxx-rock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvoid%2Fcxx-rock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localvoid","download_url":"https://codeload.github.com/localvoid/cxx-rock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554121,"owners_count":20471173,"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":[],"created_at":"2024-11-25T08:29:08.391Z","updated_at":"2025-03-20T04:42:33.981Z","avatar_url":"https://github.com/localvoid.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"=============\n C++ library\n=============\n\nUtils\n=====\n\nData Member Pointer\n-------------------\n\nData Member Pointer contains information on how to access data member\nin class. This type is useful for implementing intrusive containers.\n\nExample\n^^^^^^^\n\n::\n\n    class Item {\n    private:\n      int x_ = 0;\n      int y_ = 0;\n    public:\n      using x_dmp = dmp\u003cint Item::*, \u0026Item::x_\u003e;\n    };\n\n    Item i;\n    int *x = Item::x_dmp::to_member(\u0026i);\n\nContainers\n==========\n\nIntrusive List\n--------------\n\nSimple linked-list container that supports removing of random elements\nwith O(1) complexity.\n\nSize of a head and node elements is equal to size of two pointers.\n\n============= ==========\nOperation     Complexity\n============= ==========\npush_back     O(1)\npush_front    O(1)\npop_front     O(1)\npop_back      O(1)\nerase         O(1)\n============= ==========\n\nExample\n^^^^^^^\n\n::\n\n    class Item {\n    private:\n      int x_ = 0;\n      int y_ = 0;\n      list_node item_idx_;\n    \n    public:\n      using item_idx_dmp = dmp\u003clist_node Item::*, \u0026Item::item_idx_\u003e;\n    };\n\n    list\u003cItem::item_idx_dmp\u003e items;\n    Item i1;\n    Item i2;\n    items.push_back(i1);\n    items.push_back(i2);\n\nIntrusive Chain\n---------------\n\nContainer with a stack like behaviour, but support removing of random\nelements with O(1) complexity.\n\nSize of a head element is equal to size of one pointer, and size of\nnode element is equal to size of two pointers.\n\n============= ==========\nOperation     Complexity\n============= ==========\npush          O(1)\npop           O(1)\nerase         O(1)\n============= ==========\n\n\nExample\n^^^^^^^\n\n::\n\n    class Item {\n    private:\n      int x_ = 0;\n      int y_ = 0;\n      chain_node item_idx_;\n    \n    public:\n      using item_idx_dmp = dmp\u003cchain_node Item::*, \u0026Item::item_idx_\u003e;\n    };\n\n    chain\u003cItem::item_idx_dmp\u003e items;\n    Item i1;\n    Item i2;\n    items.push(i1);\n    items.push(i2);\n\n\nIntrusive Stack\n---------------\n\nSimple stack container.\n\nSize of a head and node elements is equal to size of one pointer.\n\n============= ==========\nOperation     Complexity\n============= ==========\npush          O(1)\npop           O(1)\n============= ==========\n\nExample\n^^^^^^^\n\n::\n\n    class Item {\n    private:\n      int x_ = 0;\n      int y_ = 0;\n      stack_node item_idx_;\n    \n    public:\n      using item_idx_dmp = dmp\u003cstack_node Item::*, \u0026Item::item_idx_\u003e;\n    };\n\n    stack\u003cItem::item_idx_dmp\u003e items;\n    Item i1;\n    Item i2;\n    items.push(i1);\n    items.push(i2);\n\n\nIntrusive Queue\n---------------\n\nSimple queue container.\n\nSize of a head element is equal to size of two pointer, and size of\nnode element is equal to size of one pointer.\n\n============= ==========\nOperation     Complexity\n============= ==========\npush          O(1)\npop           O(1)\n============= ==========\n\n\nExample\n^^^^^^^\n\n::\n\n    class Item {\n    private:\n      int x_ = 0;\n      int y_ = 0;\n      queue_node item_idx_;\n    \n    public:\n      using item_idx_dmp = dmp\u003cqueue_node Item::*, \u0026Item::item_idx_\u003e;\n    };\n\n    queue\u003cItem::item_idx_dmp\u003e items;\n    Item i1;\n    Item i2;\n    items.push(i1);\n    items.push(i2);\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalvoid%2Fcxx-rock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalvoid%2Fcxx-rock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalvoid%2Fcxx-rock/lists"}