Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 2.52 KB

File metadata and controls

41 lines (30 loc) · 2.52 KB

Lab Activity 1: Introduction to Operator Overloading

Objective: Understand the basic concept of operator overloading and its use cases. Task: Create a class Counter and overload the ++ operator to increment the counter value.

Lab Activity 2: Overloading Unary Operators

Objective: Learn to overload unary operators for custom behavior. Task: Overload the -- (decrement) operator for the Counter class from Lab 1.

Lab Activity 3: Overloading the Copy Assignment Operator

Objective: Implement deep copying using the copy assignment operator. Task: Create a class Matrix with dynamic memory allocation and overload the = operator to perform a deep copy.

Lab Activity 4: Overloading the Move Assignment Operator

Objective: Implement efficient object transfers using the move semantics. Task: Modify the Matrix class to include an overload of the move assignment operator that transfers ownership of resources.

Lab Activity 5: Overloading Binary Arithmetic Operators as Member Functions

Objective: Overload operators as class member functions for arithmetic operations. Task: Overload the + and - operators in the Matrix class to allow for matrix addition and subtraction.

Lab Activity 6: Overloading Binary Arithmetic Operators as Global Functions

Objective: Overload operators as global functions to handle arithmetic between different types. Task: Overload the * operator to perform multiplication between a Matrix object and a scalar value as a global function.

Lab Activity 7: Overloading the Stream Insertion Operator

Objective: Overload the << operator for custom object output formatting. Task: Overload the stream insertion operator to output the contents of a Matrix object in a formatted manner.

Lab Activity 8: Overloading the Stream Extraction Operator

Objective: Overload the >> operator for custom object input. Task: Overload the stream extraction operator to input values into a Matrix object.

Lab Activity 9: Overloading Subscript Operators for a Container Class

Objective: Overload the subscript operators to access elements in a custom container. Task: Create a class ArrayWrapper and overload the [] operator to access elements as if the class were an array.

Lab Activity 10: Overloading Comparison Operators

Objective: Learn to overload comparison operators for user-defined types. Task: Overload the == and != operators for the Matrix class to compare two matrices for equality and inequality.