{"id":15047864,"url":"https://github.com/goblinhack/c-plus-plus-examples","last_synced_at":"2025-04-10T01:08:22.024Z","repository":{"id":138350268,"uuid":"263932003","full_name":"goblinhack/c-plus-plus-examples","owner":"goblinhack","description":"A collection of  C++ examples, all compilable. Covers from C++11 to C++20.","archived":false,"fork":false,"pushed_at":"2025-02-25T19:03:55.000Z","size":1259,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T01:08:17.443Z","etag":null,"topics":["c-plus-plus","c-plus-plus-11","c-plus-plus-14","c-plus-plus-17","cplusplus","cplusplus-11","cplusplus-14","cplusplus-17","std","std-map","std-thread","tutorial"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goblinhack.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":"2020-05-14T14:05:15.000Z","updated_at":"2025-02-25T19:03:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb09c841-5a84-4ffd-a954-04ec5c0345f8","html_url":"https://github.com/goblinhack/c-plus-plus-examples","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/goblinhack%2Fc-plus-plus-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Fc-plus-plus-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Fc-plus-plus-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Fc-plus-plus-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goblinhack","download_url":"https://codeload.github.com/goblinhack/c-plus-plus-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137887,"owners_count":21053775,"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":["c-plus-plus","c-plus-plus-11","c-plus-plus-14","c-plus-plus-17","cplusplus","cplusplus-11","cplusplus-14","cplusplus-17","std","std-map","std-thread","tutorial"],"created_at":"2024-09-24T21:05:23.604Z","updated_at":"2025-04-10T01:08:22.000Z","avatar_url":"https://github.com/goblinhack.png","language":"C++","readme":"Modern C++ examples\n===================\n\nAre you looking for a collection of short straightforward snippets of\nmodern C++ covering the core features in C++11 and beyond? Of course \nyou are!\n\nAs I'm constantly learning C++ myself (disclaimer, I'm not an expert,\njust enthusiastic), I wanted to create some simple examples of each\nof the main features of the language. You can build each example\nindividually or as a whole.\n\nLet me know if this is useful to anyone or if there are any areas you want\ncovered. Suggestions, enhancements and errata welcome.\n\nThis is a (probably perpetual) work in progress!\n\n[How to print hello world in color in C++, because why not](hello_world_color/README.md)\n\n[How to use read a file in far too many ways](std_file_read/README.md)\n\n[How to use scoped enums](scoped_enums/README.md)\n\n[How to use std::initializer_list](initializer_lists/README.md)\n\n[How to use std::initializer_list with your own container like class](initializer_lists_with_custom_vector/README.md)\n\n[How to use constexpr for fame and profit](constexpr/README.md)\n\n[How to use decltype](decltype/README.md)\n\n[How to use range-based for loops](range_based_for_loop/README.md)\n\n[How to use range-based for loops with your own iterator](range_based_for_loop_custom_begin_end/README.md)\n\n[How to use lambdas](lambda/README.md)\n\n[How to use std::to_string with custom classes and templates](std_to_string/README.md)\n\n[How to use std::for_each and how it differs from std::transform](std_for_each_and_transform/README.md)\n\n[How to use std::map with a custom key](std_map_with_custom_key/README.md)\n\n[How to use std::map for reverse sorting](std_map_reverse_sort/README.md)\n\n[How to use std::unordered_map](std_unordered_map/README.md)\n\n[How to use std::multiset and std::multiset::equal_range](std_multiset/README.md)\n\n[How to use std::set](std_set/README.md)\n\n[How to use std::unordered_set](std_unordered_set/README.md)\n\n[How to use std::sort with a custom container and iterators](std_sort_with_custom_iterators/README.md)\n\n[How to use std::function and the 'using' keyword](std_function_and_using/README.md)\n\n[How to use std::bind](std_bind/README.md)\n\n[How to use std::bind with methods or proxy functions](std_bind_with_a_method/README.md)\n\n[How to use std::bind with callback inside a class](std_bind_with_a_class_callback/README.md)\n\n[How to use std::move to avoid the cost of temporaries](std_move/README.md)\n\n[How to use std::forward to invoke the exactly correct function through a template](std_forward/README.md)\n\n[How to use std::unique_ptr](std_unique_ptr/README.md)\n\n[How to use std::unique_ptr with a custom deallocator](std_unique_ptr_with_custom_deallocator/README.md)\n\n[How to use std::unique_ptr for file handling](std_unique_ptr_for_file_handling/README.md)\n\n[How to use std::shared_ptr](std_shared_ptr/README.md)\n\n[How to use std::shared_ptr with your own wrapper for extra debugging](std_shared_ptr_wrapper/README.md)\n\n[How to use std::thread in three different ways](std_thread/README.md)\n\n[How to use std::thread and std::mutex to implement a timeout around a function](std_thread_timeout/README.md)\n\n[How to use variadic templates for recursion instanity](variadic_templates/README.md)\n\n[How to use std::thread and variadic templates to call a function with variable number and types of args](std_thread_timeout_template/README.md)\n\n[How to use std::function with variadic templates](std_function_with_variadic_template/README.md)\n\n[TODO How to use std::remove_if and std::erase](TODO/README.md)\n\n[TODO How to use std::erase_if](TODO/README.md)\n\n[TODO How to use std::mutex](TODO/README.md)\n\n[TODO How to use std::chrono](TODO/README.md)\n\n[TODO How to use std::accumulate and std::reduce](TODO/README.md)\n\nTo build all the examples, just do:\n```C++\n   make \n```\nTo build all the examples and the documentation and run every examle, do:\n```C++\n   sh ./RUNME\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoblinhack%2Fc-plus-plus-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoblinhack%2Fc-plus-plus-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoblinhack%2Fc-plus-plus-examples/lists"}