Skip to content

quanpham0805/cs246e-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

CS 246 Enriched (Object Oriented Programming) Notes

Course information at the bottom of the page.

These notes cover CS 246E in Fall 2021. The original notes from Fall 2017 can be found here, by Clayton Halim

The textbook used is Stroustrup, Bjarne. The C++ Programming Language, 4th edition, Addison Wesley, reading sections are referenced to this book.

Table of Contents (all F2021 updated)

  1. Program Input / Output

  2. Separate compilation

  3. Linear Collections and Modularity

  4. Linear Collections and Memory Management

  5. The Copier is broken!

  6. Moves

  7. I want a constant vector

  8. Tampering

  9. Efficient Iteration

  10. Staying in bounds

  11. I want a vector of chars

  12. Better Initialization

  13. I want a vector of Posns

  14. Less Copying!

  15. Memory management is hard!

  16. Is vector exception safe?

  17. Insert/remove in the middle

  18. Abstraction over containers

  19. Heterogeneous Data

  20. I'm leaking!

  21. I want a class with no objects

  22. The copier is broken (again)

  23. I want to know what kind of Book I have

    A Big Unit on Object Oriented Design

  24. Shared Ownership

  25. Abstraction over Iterators

  26. Generalize the Visitor pattern

  27. I want an ever faster vector

  28. I want to print the unprintable!

  29. Collecting Stats

  30. Resolving Method Overrides at Compile Time

  31. Polymorphic Cloning

  32. Logging

  33. Generalize the Visitor Pattern! Part 2!

  34. Policies

  35. Total Control

  36. I want total control over vectors and lists

  37. A fixed-size allocator

  38. I want a (tiny bit) smaller vector class

2021 Tutorials (pdf notes in odd numbers):

  1. Shell
  2. Valgrind and GDB
  3. Git and VCS
  4. Recursive Descent parsing
  5. Model View Controller (MVC)

Other

  1. Valgrind + GDB
  2. Recursive Descent

Discussions

  1. Modules (C++20)
  2. If / Switch Initialization (C++17)
  3. The Spaceship Operator (C++20)
  4. Structure Bindings (C++17)
  5. Class Template Argument Deduction (C++17)
  6. Range Abstraction (C++20)
  7. Unions Revisited (C++17)
  8. Revisiting void* (C++17)
  9. Ownership of Strings (C++17)
  10. fold expression (C++17)
  11. std::variant revisited (C++17)
  12. Concepts (C++ 20)
  13. constexpr if (C++17)

Index

Work in progress (feel free to contribute)!

A

B

  • Basic Guarantee

C

D

E

  • Exception Safety

F

G

H

I

J

K

L

M

  • Makefile
  • Member Initialization List
  • Move Assignment
  • Move Constructor

N

O

P

  • Partial Assignment
  • Polymorphism
  • Pure Virtual Function

Q

R

  • Reference
  • Reinterpret Cast
  • Resource Acquisition is Initialization (RAII)
  • Round Bracket Initialization
  • Run-Time Type Information (RTTI)
  • Rvalue Reference

S

T

  • Template
  • Template Metaprogramming

U

V

W

X

Y

Z

Course Information (Fall 2021 Pandemic version)

Brad Lushman
Online, M3 1006
bmlushma@uwaterloo.ca
https://www.student.cs.uwaterloo.ca/~cs246e

Must use Linux:

Windows:

putty.exe

  • connect to linux.student.cs.uwaterloo.ca
  • enable X11 forwarding
  • win scp

Mac/Linux:

Also Install xwindows server, eg. Xming, XQuartz

Goals:

  • Meet the CS 246 objectives, more breadth, more depth
  • A course on abstraction
  • Demand-driven, problem-oriented presentation, introduce C++ concepts as needed
  • Linux tools on the side/tutorials
  • C++17, C++20 features during discussion sessions
  • Lots of template metaprogramming

New problems:

  • Separated problem 2 out from first problem.
  • Added generalized versions of the Visitor Pattern with lots of template metaprogramming recursion magik in problem 26 and 33
  • Added printing the unprintable in problem 28, inspired by a former student
  • Added Policies in problem 34

About

Updated OOP notes, Fall 2021

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published