Operator() and [], Writing Tests, Bitwise Operations

Channel:
Subscribers:
2,640
Published on ● Video Link: https://www.youtube.com/watch?v=QCx-rnZ5CrI



Duration: 54:30
222 views
3


We went over the operator() method, which lets you treat an object like a function, and the operator[] method, which lets you treat an object like an array

We then did a bit of lab time in which students had to collectively generate tests for the next homework assignment, during which a fair bit of disagreement over how to interpret the rules took place, which is actually a pretty realistic scenario

Finally we finished with the final data structure of the class, the int.

You can treat a 32-bit int like it is 32 booleans, and insert, search, and delete individual bits in it, which allows you to pack a lot more data into the same variables, and reduce your RAM usage, network traffic, hard drive space, and so forth.







Tags:
csci 41
operator()
operator[]
c++
functors
TDD
bitwise operations
bitset
int