Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ exercises/2.1-class-types/test
exercises/2.2-complex/test
exercises/3-containers/part1/test
exercises/3-containers/part2/test
exercises/4-pointers/pointers
exercises/5-templates/part1/sum
exercises/5-templates/part2/test
exercises/6.1-my-array/part*/my_array
exercises/6.2-special-pointers/part1/unique
exercises/6.2-special-pointers/part2/shared
exercises/8-algorithm/ex
exercises/9-eigen/explicit
exercises/9-eigen/implicit
exercises/9-eigen/sparse
exercises/9-eigen/*.txt
exercises/9-eigen/*.gif
exercises/10-threads/area

lectures/1-cpp-intro/auto/auto
lectures/1-cpp-intro/hello/hello
lectures/1-cpp-intro/sum/sum
7 changes: 6 additions & 1 deletion exercises/2.2-complex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ The files `complex.hpp` and `complex.cpp` contain a partially working comple
You can compile and run with:

```
$ make && ./testc++ --std=c++14 -I../include -c -o complex.o complex.cppc++ --std=c++14 -I../include -c -o test.o test.cppc++ complex.o test.o -o test===============================================================================All tests passed (34 assertions in 6 test cases)
$ make && ./test
g++ --std=c++14 -I../include -c -o complex.o complex.cpp
g++ --std=c++14 -I../include -c -o test.o test.cpp
g++ complex.o test.o -o test
===============================================================================
All tests passed (34 assertions in 6 test cases)
```

But to get to this point you need to complete the code and fix a few bugs!
36 changes: 25 additions & 11 deletions lectures/1-cpp-intro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ styles that people have developed over the decades.

Please ask questions any time!

---
# A bit of history

- C++ was originally designed as an extension of C
- Well written C tends to be legal C++ but C is not a subset of C++
- There are programs that are valid C but not valid C++
- However, C++ supports every programming technique supported by C


- Released in 1985, but first standardised in 1998 with C++98

- New features added to the standard over time

---
# The misunderstood monster

Expand All @@ -86,20 +99,19 @@ https://commons.wikimedia.org/w/index.php?curid=3558176
- "Expert friendly"

---
# Octopus vs Swiss Army knife
# The misunderstood monster

> "C++ is an octopus made by nailing extra legs onto a dog" - Steve Taylor
- However!

.center[![:scale_img 40%](octodog.jpg) ![:scale_img 40%](sak.jpg)]
- We can pick and choose the parts of the standard we want to use

But you can cut off some extra legs to get the right dog for your
program!
- Not expected to know "all of C++"

- Pick a subset, write some code, and gradually learn more of the language, its libraries, and its tools

???

Why is it called C++20?

Because that's how many legs they had to nail on to "fix" the octopus.

---
# The philosophy of C++ (community)
Expand All @@ -119,17 +131,19 @@ Because that's how many legs they had to nail on to "fix" the octopus.
---
# C++ is alive!

C++ is a work in progress.
- C++ is a work in progress.

Every three years there is a new update to the International Standard
- Every three years there is a new update to the International Standard (since C++11)

C++20 is only fully supported by MSVC (although GCC is nearly there). Major
- C++20 is only fully supported by MSVC (although GCC is nearly there). Major
new features are ranges, coroutines, concepts, and modules

Latest one, C++23 has been released. Major features include
- Latest one, C++23 has been released. Major features include
networking, string formatting, executors, and consolidation of new
C++20 features

- Good summary of compiler support here: https://en.cppreference.com/w/cpp/compiler_support

---
# References
- Bjarne Stroustrup, "Programming: Principles and Practice Using C++"
Expand Down
23 changes: 20 additions & 3 deletions lectures/2-classes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,23 @@ Refer back to the last slide codes and ask
mutable reference then it would be a mutable ref while `auto const&`
would have stayed constant)

---
template: titleslide
# Exercise

---
# Note: Complex numbers

- A complex number is a number that can be expressed in the form `a+bi` where:
- `a` is the real part
- `b` is the imaginary part
- `i` is the imaginary unit defined as the square root of `-1`
- We can define basic operations for two complex numbers `a=x+yi` and `b=u+vi` as:
- `a + b = (x + yi) + (u + vi) = (x + u) + (y + v)i`
- `a - b = (x + yi) - (u + vi) = (x - u) + (y - v)i`

.center[![:scale_img 40%](complex_numbers.svg)]

---
# Exercise

Expand All @@ -869,9 +886,9 @@ complex number class and `test.cpp` holds some basic unit tests.
You can compile and run with:
```
$ make && ./test
c++ --std=c++14 -I../include -c -o complex.o complex.cpp
c++ --std=c++14 -I../include -c -o test.o test.cpp
c++ complex.o test.o -o test
g++ --std=c++14 -I../include -c -o complex.o complex.cpp
g++ --std=c++14 -I../include -c -o test.o test.cpp
g++ complex.o test.o -o test
===============================================================================
All tests passed (34 assertions in 6 test cases)
```
Expand Down
Loading