Skip to content

jabluko/CppCourse

Repository files navigation

CppCourse

Those are my solutions to the exercises from the 2024 C++ course at the Faculty of Mathematics, Informatics, and Mechanics of the University of Warsaw.

The course enhanced abilities in using C++ constructs like RAII, smart pointers, templates, lambdas, operator overloading, constexpr computation and modular architecture all while maintaining robust exception safety, effective resource handling and functional immutable abstractions.

Here is the quick rundown of those projects with the most important concepts and examples of usage thereof:

  1. Medals
    • std::regex: input validation
    • Error handling
    • Strict STL usage
  2. String Queue
    • namespace, extern C and header guards to connect C and C++
    • Safe global-state management, including avoiding static-initialization-order fiasco and properly hiding internal data structures
    • Detailed diagnostic logging enabled/disabled conditionally via the -DNDEBUG flag without changing the core logic
  3. Knights Tournament
    • Explicit constructors, copy/move operations,
    • Battle logic encoded through <=> and ==,
    • Operators += and + for looting knights,
    • constexpr support and a compile-time TRAINEE_KNIGHT (usage of inline).
    • Formatted printing of the tournament state
    • consteval function max_diff_classes
  4. Binder
    • Copy-on-write design: Internal state is shared with deferred copies upon modification; hence efficiency and iterator stability are maintained
    • Strong exception safety: the state is preserved after an error occurs
    • RAII-based resource management, including smart pointers
    • Iterators: implementing a std::forward_iterator with const-correct iteration.
  5. Counters
    • C++20 modules: structure the program into .cppm translation units providing stable interfaces and avoiding preprocessor directives
    • Strong input validation: instant error identification, with line number monitoring and rigid formatting rules preserving state without interruption
  6. Functional Lists
    • Higher-order functions: Lists as folds (f, a) → result
    • Type-generic callables: Operator templates need careful type propagation
    • std::function to maintain type correctness
    • Copies by default; std::ref and std::reference_wrapper for references

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published