In Spring 2012, I offered a one-hour-per-week seminar on "advanced"
C++, focusing on the new C++11 standard. It has finished. Thank you to
all of you who enthusiastically participated in the seminar.
C++ usage has changed drastically over the past ten years with much
more advanced use of templates, meta-programming, functors, and other
high-level concepts becoming common. Last year, a new C++ standard
(C++11, formerly C++0x) was released with many new and exciting changes
to the language that follow these trends.
Each week had programming examples, collected below. At the end
are the links to useful information around the web.
Week | Date | Topic | Files |
1 | Apr 4 | C++11 overview, easy useful changes: >>,
nullptr, std::array, range-based for, auto, decltype, begin & end |
Original C++03 simpmat version,
C++11 simpmat version,
Final C++11 simpmat version,
C++11 auto keyword examples,
C++11 range-based for examples
|
2 | Apr 11 | move semantics: r-value references, move
constructor / operator=, use in STL |
Original C++03 wordset version,
"words" file read by wordset,
Original C++03 movetst version,
C++11 wordset version,
C++11 movetst version
C++11 rrefex
|
3 | Apr 18 | More on constructors: compiler-made
constructors/destructors/assignments, initializer lists, deligation,
inheriting, =default, =delete |
implicit methods example,
wordset11.cc, first changes,
initializer list example,
wordset11.cc with init lists,
last example
|
4 | Apr 25 | Prefer direct obj to ptrs, shared_ptr,
unique_ptr, weak_ptr |
memory leak example,
memory leak example, part 2,
memory leak example, fix w/o ptrs,
memory leak example, fix w/ ptrs,
temp obj lifetime example,
nullptr example,
unique/shared ptr example
txt file for mem leak example
txt file for ptr example
|
5 | May 2 | functors, lambda functions,
currying, closures |
sortwords example,
findword example,
unique/shared ptr example w/ lambdas,
std::function example,
parallel-array for-each example
|
6 | May 9 |
STL: hash tables, random, use with functors/lambda fns |
emplace example,
lz78 hash table example,
random number example
|
7 | May 16 |
timers, raw string literals, unicode support, regex |
timer example,
unicode and raw string example,
user-defined literals example,
regular expression example 1,
regular expression example 2
|
8 | May 23 | concurrency support in C++11 |
Basic thread example,
async & futures example,
bank account, no mutex,
bank account, mutexes,
bank account, locks,
bank account, multiple mutexes,
parallel primality,
parallel primality, thread pool
|
9 | May 30 | perfect forwarding, variadic templates |
motivating perfect forwarding example,
motivating perfect forwarding example v2,
motivating perfect forwarding example v3,
forwarding example,
variadic templates example 1,
variadic templates example 2,
multidimensional array example
(fixed),
memoizing header,
memoized fib,
memoized shortest path
|
10 | Jun 6 | constexpr, SFINAE |
constexpr version of prime,
example of SFINAE,
TMP version of prime (incorrect),
TMP version of prime (correct),
TMP version of print
|
C++11 things I didn't get to |
text file list
|