{"id":26902529,"url":"https://github.com/0xromjobert/cpp07","last_synced_at":"2025-04-01T09:43:51.931Z","repository":{"id":223894196,"uuid":"760144433","full_name":"0xromjobert/cpp07","owner":"0xromjobert","description":"42 school exercices on templated classes and functions. Generic programming concept learnt through the creation of templates such as a generic iterator or dynamic array","archived":false,"fork":false,"pushed_at":"2024-03-19T17:56:07.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T18:46:55.650Z","etag":null,"topics":["array","cpp","cpp98","generic-programming","iterator","template-class"],"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/0xromjobert.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":"2024-02-19T21:35:38.000Z","updated_at":"2024-06-20T09:52:27.000Z","dependencies_parsed_at":"2024-02-22T16:47:09.530Z","dependency_job_id":"706415b5-3fc0-4f28-b769-69e34154d892","html_url":"https://github.com/0xromjobert/cpp07","commit_stats":null,"previous_names":["romz8/cpp07","0xromjobert/cpp07"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2Fcpp07","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2Fcpp07/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2Fcpp07/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2Fcpp07/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xromjobert","download_url":"https://codeload.github.com/0xromjobert/cpp07/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620211,"owners_count":20806718,"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":["array","cpp","cpp98","generic-programming","iterator","template-class"],"created_at":"2025-04-01T09:43:51.517Z","updated_at":"2025-04-01T09:43:51.922Z","avatar_url":"https://github.com/0xromjobert.png","language":"C++","readme":"# **C++ Module 07 - Templated Classes and Functions**\n\n## **Overview**\n\nThis repository contains the implementations for Module 07 of the 42 School's C++ curriculum, focusing on the use of templated classes and functions. C++ templates allow for generic programming, enabling functions and classes to operate with any data type without being specifically tailored for each one.\n\n# **Status**\n\nValidated on 21/02/2024. Grade: 100%.\n\n## **General Information**\n\n- **Compiler used:** **`c++`**\n- **Compilation flags:** **`Wall -Wextra -Werror -std=c++98`**\n- **Standard:** C++98 for compliance and simplicity, per the 42 School curriculum's requirements.\n\n## **Projects**\n\nThis module is divided into three exercises, each emphasizing different aspects of C++ templated programming.\n\n### **Exercise 00: Start with a few functions**\n\n- **Directory:** **`ex00/`**\n- **Files:** **`Makefile`**, **`main.cpp`**, **`whatever.hpp`**\n- **Description:** Implement templated functions **`swap`**, **`min`**, and **`max`** that can operate on any data type supporting comparison operations.\n- **Key Concepts:** Templated functions, Type agnosticism, Comparison operators.\n\n### **Exercise 01: Iter**\n\n- **Directory:** **`ex01/`**\n- **Files:** **`Makefile`**, **`main.cpp`**, **`iter.hpp`**\n- **Description:** Create a templated function **`iter`** that applies a given function to every element of an array of any data type.\n- **Key Concepts:** Templated functions, Function pointers as arguments, Arrays manipulation, Type abstraction.\n\n### **Exercise 02: Array**\n\n- **Directory:** **`ex02/`**\n- **Files:** **`Makefile`**, **`main.cpp`**, **`Array.hpp`**, (optional) **`Array.tpp`**\n- **Objective:** Develop a templated class **`Array`** that encapsulates an array of any type, with dynamic sizing, element access, and deep copying. This exercise aims to demonstrate the utility of templates in creating versatile data structures. The **`Array`** class should manage memory carefully to avoid leaks and should throw an exception for out-of-bounds access attempts, ensuring safe and flexible array manipulation.\n- **Key Concepts:** Templated classes, Memory management, Operator overloading, Exception handling.\n\n## **Compilation and Usage**\n\nEach exercise comes with a **`Makefile`** facilitating the compilation process. Use the following **`make`** commands to compile and clean each project:\n\nEach exercise directory contains a Makefile for easy compilation. To compile an exercise, navigate to its directory and run:\n\nAfter compilation, an executable named after the exercise (e.g., **`ex00`**, **`ex01`**, **`ex02`**) will be created. Run it with **`./[executable name]`** to see the functionality of the implemented templates.\n\nFor example :\n\n```bash\ncd ex00 \u0026\u0026 make \u0026\u0026 ./ex00\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xromjobert%2Fcpp07","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xromjobert%2Fcpp07","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xromjobert%2Fcpp07/lists"}