{"id":26078223,"url":"https://github.com/jos-felipe/cpp-module-07","last_synced_at":"2025-06-12T15:33:19.055Z","repository":{"id":277427210,"uuid":"932374897","full_name":"jos-felipe/cpp-module-07","owner":"jos-felipe","description":"This module is designed to help you understand Templates in CPP.","archived":false,"fork":false,"pushed_at":"2025-02-18T14:50:31.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T03:51:17.382Z","etag":null,"topics":["imperative-programming","object-oriented-programming","rigor"],"latest_commit_sha":null,"homepage":"https://projects.intra.42.fr/cpp-module-07/mine","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/jos-felipe.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":"2025-02-13T20:10:46.000Z","updated_at":"2025-02-18T14:50:34.000Z","dependencies_parsed_at":"2025-02-17T14:31:19.589Z","dependency_job_id":null,"html_url":"https://github.com/jos-felipe/cpp-module-07","commit_stats":null,"previous_names":["jos-felipe/cpp-module-07"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jos-felipe/cpp-module-07","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jos-felipe%2Fcpp-module-07","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jos-felipe%2Fcpp-module-07/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jos-felipe%2Fcpp-module-07/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jos-felipe%2Fcpp-module-07/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jos-felipe","download_url":"https://codeload.github.com/jos-felipe/cpp-module-07/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jos-felipe%2Fcpp-module-07/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259493748,"owners_count":22866386,"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":["imperative-programming","object-oriented-programming","rigor"],"created_at":"2025-03-09T03:50:24.034Z","updated_at":"2025-06-12T15:33:18.899Z","avatar_url":"https://github.com/jos-felipe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CPP Module 07 - C++ Templates\n\nThis module focuses on C++ Templates, a powerful feature that allows writing generic code that works with different data types while maintaining type safety.\n\n## Overview\n\nThe project consists of three exercises that explore different aspects of C++ templates:\n\n1. **Exercise 00: Start with a few functions**\n   - Implementation of basic function templates: swap, min, and max\n   - Understanding template syntax and usage\n   - Working with different data types using the same function template\n\n2. **Exercise 01: Iter**\n   - Implementation of a function template that applies a function to each element of an array\n   - Learning about template function parameters\n   - Understanding how to work with arrays and function pointers in templates\n\n3. **Exercise 02: Array**\n   - Implementation of a template class for a dynamic array\n   - Understanding template class design\n   - Managing memory allocation and exception handling\n   - Implementing copy constructor and assignment operator for template classes\n\n## Technical Requirements\n\n- Compiler: c++ (C++98 standard)\n- Compilation flags: -Wall -Wextra -Werror\n- Make: Compilation automation\n- Each exercise includes its own Makefile\n\n## Installation \u0026 Usage\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/jos-felipe/cpp-module-07.git\ncd cpp07\n```\n\n2. Choose an exercise directory and compile:\n```bash\ncd ex00\nmake\n```\n\n3. Run the program:\n```bash\n./program_name\n```\n\n## Exercise Details\n\n### Exercise 00: Function Templates\n- Files: `whatever.hpp`, `main.cpp`\n- Implements three function templates:\n  - `swap\u003cT\u003e`: Swaps two values of the same type\n  - `min\u003cT\u003e`: Returns the smaller of two values\n  - `max\u003cT\u003e`: Returns the larger of two values\n\n### Exercise 01: Iter Template Function\n- Files: `iter.hpp`, `main.cpp`\n- Implements a template function that:\n  - Takes an array address, length, and function pointer\n  - Applies the function to each array element\n  - Works with any data type\n\n### Exercise 02: Array Template Class\n- Files: `Array.hpp`, `main.cpp`\n- Implements a template class with:\n  - Default and parametric constructors\n  - Copy constructor and assignment operator\n  - Subscript operator with bounds checking\n  - Size method\n  - Exception handling for out-of-bounds access\n\n## Learning Outcomes\n\n- Understanding C++ template syntax and usage\n- Working with function and class templates\n- Managing memory in template classes\n- Implementing exception handling in templates\n- Creating generic code that works with multiple data types\n\n## Author\n\nJosé Felipe ([jos-felipe](https://github.com/jos-felipe))  \nEmail: josfelip@student.42sp.org.br\n\n## License\n\nThis project is part of the 42 School curriculum. For more information about 42 and its projects, visit [42sp.org.br](https://www.42sp.org.br/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjos-felipe%2Fcpp-module-07","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjos-felipe%2Fcpp-module-07","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjos-felipe%2Fcpp-module-07/lists"}