{"id":20614414,"url":"https://github.com/aryan-programmer/utils","last_synced_at":"2025-08-16T11:43:22.122Z","repository":{"id":162947918,"uuid":"135896041","full_name":"aryan-programmer/utils","owner":"aryan-programmer","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-24T05:33:36.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T04:12:43.413Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aryan-programmer.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-03T10:54:49.000Z","updated_at":"2019-11-08T14:51:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8506147-f4cc-4c04-aec3-7fd490b92d26","html_url":"https://github.com/aryan-programmer/utils","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/aryan-programmer%2Futils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aryan-programmer%2Futils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aryan-programmer%2Futils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aryan-programmer%2Futils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aryan-programmer","download_url":"https://codeload.github.com/aryan-programmer/utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242268962,"owners_count":20100070,"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-16T11:12:41.135Z","updated_at":"2025-03-06T18:43:19.260Z","avatar_url":"https://github.com/aryan-programmer.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# utils\nA set of varied utilities for C++.\n\nutilities.h:\nThe utilities.h header file contains multiple using type-alias like uint for unsigned int,\nreal for long double to shorten typing.\n\nAnd it also contains functions for random number generation like, \nrand_long to get a random value of type long long,\nor rand_init to seed the random value generator based on the current timestamp,\nand shuffle_collection to shuffle any collection, that overloads the array subscript ([]) operator, etc.\n\nAnd some structs that delegate to operators, and some mathematical functions like \nabs to get the absolute value of an integral or floating-point type or \nfloor to convert a floating-point type to an integral type by removing the digits after the floating-point.\n\nAlong with type-traits like \nrem_ref, rem_const, etc. \nwhich remove references, const qualifiers, etc from types, and other type traits like \nis_ref, is_lval_ref, etc \nto check for certain attributes on types, \nor the select_t to select a type if a condition evaluates to true.\n\niterator_addons.h:\nThe iterator_addons.h header file contains\nthe classes rec_range paired with rec_iterator which are best described and \nexplained in my youtube video channel.\n\nAnd the class iterator_pair to pair begin and end iterators \nsuch that iterator_pair::begin() returns the first iterator and \niterator_pair::end() returns the second iterator.\n\nAnd a class, reverse_iterator_adapter that maps \nrbegin to begin and \nrend to end and the function reverse_adapt makes for easy construction of this class.\n\nAlong with a transform_if function best described and explained in my youtube video channel.\n\nAnd multiple using type-alias related to std::iterator_traits to shorten typing.\n\nIt also contains utils::split which can split an std::basic_string at any occurrence of a \ndelimiter std::basic_string and save the split std::basic_string to an output iterator.\n\nobject.h:\nThe object.h header file contains a class called object that can hold a value of any type \nlike a void* and it also occupies as-much-as space, on the heap (or free-store) \nand on the stack, as a void*.\n\nThe function obj_cast returns a reference/pointer to the value held in the object.\n\nThe type to be held in the object has to be copy-constructable.\n\nfunction_addons.h:\nThe function_addons.h header file contains functions that \nreturn function objects or work with functions e.g.\nThe func_chain can be used like\nfunc_chain(f,g,h)(1,2,3) which is equal to\nf(g(h(1,2,3)))\nbut func_chain, one might say, can be easily be replicated with a lambda \n([](int a, int b, int c)\n{return f(g(h(a, b, c)));}),\nbut that’s unlike multicall which can be used like\nmulticall(f,g,h)(1,2,3) which is equal to\nf(1,2,3);\ng(1,2,3);\nh(1,2,3);\nbut that’s harder to represent with a lambda.\nThe returned functor (function object) from multicall and func_chain can be \nstored in an auto variable or an std::function object.\nThen there is the function for_each_value which calls a function for a set of values. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faryan-programmer%2Futils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faryan-programmer%2Futils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faryan-programmer%2Futils/lists"}