Welcome to the repository for C++ Module 07. Explore the fascinating world of C++ templates.
C++ is a versatile programming language that builds upon C to introduce Object-Oriented Programming. This module aligns with the C++98 standard and provides exercises focusing on C++ templates.
- Function Templates: Implement swap, min, and max function templates that work with any datatype supporting comparison operators.
- Function Template: Implement a function template named 'iter' that accepts an array, its length, and a function. It applies the given function to each element of the array.
- Class Template: Implement a class template named 'Array' to hold elements of any type. It should support array operations like accessing elements with the subscript operator.
- Error Handling: Handle out-of-bounds access using exceptions.
Ensure you're on a system with a C++ compiler.
Compile the exercises with the provided Makefile.
make
Execute the desired exercise. For example:
./start_with_functions input.txt