Foreign students. Foundations of Programming II 2025
Содержание
[убрать]General information
Teacher
- Гольдштейн Клим Дмитриевич
The themes for the semester are:
- templates
- exceptions
- iterators, allocators
- std containers
- smart pointers
- move-semantics
- functional objects and lambda functions
Links
Evaluation criteria
The mark is given based on 2 homeworks and oral exam. The resulting mark for the course is the average mark of marks for the homeworks and oral exam.
The examples of homework tasks:
- Implement a generic class Stack using templates, which represents a stack data structure. The class should have the following public member functions:
- Implement a custom vector class MyVector that is similar to the standard vector class in C++, but has an additional feature that allows for efficient insertion of elements in the middle of the vector. The class should have the following public member functions:
- Write the meta-function which will calculate the N-th Fibonacci number in compile time
- Write two meta-functions, that will add/remove const qualifier to the given type
- Write the variadic template function, that will calculate the size of the given arguments.
- Implement the Matrix class, which would represent an n x m matrix and support operations with matrices (addition, subtraction, multiplication). I remind you that you can (and should) do a check for the possibility of addition and multiplication in compile-time. The class should use move-semantics to optimize copying and moving objects, and use smart pointers where possible. Write at least two functions outside of the class that does something with the matrix (like transpose) and uses universal reference passing
- Write a print function that can print arguments of different types and different value categories using perfect forwarding.