{"id":21854781,"url":"https://github.com/nandite/bazaar_traits","last_synced_at":"2025-03-21T19:14:49.074Z","repository":{"id":217091459,"uuid":"496721346","full_name":"Nandite/bazaar_traits","owner":"Nandite","description":"Implementation of the C++ metaprogramming library.","archived":false,"fork":false,"pushed_at":"2022-10-17T11:12:19.000Z","size":149,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T13:43:56.405Z","etag":null,"topics":["cpp","cpp17","cpp20","metaprogramming","template-meta-programming","template-metaprogramming","traits","type-traits"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nandite.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}},"created_at":"2022-05-26T17:57:20.000Z","updated_at":"2023-06-21T09:44:34.000Z","dependencies_parsed_at":"2024-01-23T00:24:06.910Z","dependency_job_id":null,"html_url":"https://github.com/Nandite/bazaar_traits","commit_stats":null,"previous_names":["nandite/bazaar_traits"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nandite%2Fbazaar_traits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nandite%2Fbazaar_traits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nandite%2Fbazaar_traits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nandite%2Fbazaar_traits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nandite","download_url":"https://codeload.github.com/Nandite/bazaar_traits/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852681,"owners_count":20521159,"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":["cpp","cpp17","cpp20","metaprogramming","template-meta-programming","template-metaprogramming","traits","type-traits"],"created_at":"2024-11-28T02:11:18.073Z","updated_at":"2025-03-21T19:14:49.030Z","avatar_url":"https://github.com/Nandite.png","language":"C++","readme":"Bazaar traits\n===============\n\nThis project is a standalone implementation of the C++ [metaprogramming library](https://en.cppreference.com/w/cpp/meta) using C++17. Following years\nof learning about template metaprogramming and type traits, I came to the conclusion that the best way of understanding the\nfield was extensive practice. It is one of the easiest way to get up to speed on writing compile time algorithms and meta-functions. So a\nquick way to exercise was to implement the [metaprogramming library](https://en.cppreference.com/w/cpp/meta) from ground.\n\nUnlike most of the implementation (GCC, LLVM etc.), the meta-functions in this project are divided into multiple files under \nthe [include](include) directory with bases traits in their own files ([helper traits](include/helper_traits.hpp), \n[Integral constant](include/integral_constant.hpp), [logical operators](include/logical_operators.hpp)...). The bulk of\nthe meta-functions implementation however are inside the [bazaar_traits](include/bazaar_traits.hpp) file.\n\nA [synopsis](include/synopsis.hpp) file containing the list of all implemented (and to be implemented) traits is also \navailable.\n\n## Usage\n\nThis repository is a standalone CMake project. You can open it with any IDE supporting CMakeLists. You can then compile\nthe test target. Using a sufficiently modern IDE, you can take a look of the [test files](tests) and get in live\nthe results of the meta-functions calls.\n\nDepending on your compiler, you can get different results. Indeed, some traits require attributes that are only\nvisible by the compiler and thus need compiler support to be implemented. There is a good listing and explanation about which\nmeta-function need compiler support and why at this [page](https://github.com/Quuxplusone/from-scratch/blob/master/include/scratch/bits/type-traits/compiler-magic.md).\nWhen compiler support is not mandatory and not available, there are fallbacks on internal implementations of the traits \nthat try to stick at most to the C++ specifications. Otherwise, a shallow implementation is used or in certain case the \nresult is literally deactivated using false_type (equivalent to systematically return false at function calls).\n\nThis implementation has been tested using the following compilers:\n- gcc 9.4.0\n- Clang 10\n- Clang 14\n\n## Caution\n\nPlease, do not use the code of this project into production. Use instead the facilities provided through the standard\nlibrary of your C++ compiler. This repository is first and foremost for learning purposes.\n\n## CppCon talks\n\nIf you want to learn about metaprogramming, i advice watching the CppCon talks of [Walter E. Brown](https://cppcon2019.sched.com/speaker/walter_e_brown) and [Jody Hagins](https://cppcon2020.sched.com/speaker/cppcon.2020.coachhagins_gmail.com) about the subject:\n- Modern Template Metaprogramming: A Compendium [Part 1](https://www.youtube.com/watch?v=Am2is2QCvxY) \u0026 [Part 2](https://www.youtube.com/watch?v=a0FliKwcwXE).\n- Template Metaprogramming: Type Traits [Part 1](https://www.youtube.com/watch?v=tiAVWcjIF6o) \u0026 [Part 2](https://www.youtube.com/watch?v=dLZcocFOb5Q).\n\nThese talks require a good knowledge of C++ and template programming. They are not intended for beginners.\n\n## Feedback\n\nDon't hesitate if you have any suggestions for improving this project, or if you find any error. I will be glad to\nhear from you. There are traits that have been implemented yet. You can submit implementations suggestions.\nContributions are welcomed :)\n\n## License\n\nDistributed under the MIT Software License (X11 license).\nSee accompanying file LICENSE.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnandite%2Fbazaar_traits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnandite%2Fbazaar_traits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnandite%2Fbazaar_traits/lists"}