Content-type: text/html Christian R. Shelton: Courses

UCR

Computer Science and Engineering



Christian R. Shelton, Professor

C++ Seminar

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.

Materials from the offering:

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.

Topics:

General notes on C++ examples
WeekDateTopicFiles
1Apr 4C++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
2Apr 11move 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
3Apr 18More 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
4Apr 25Prefer 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
5May 2functors, lambda functions, currying, closures sortwords example, findword example, unique/shared ptr example w/ lambdas, std::function example, parallel-array for-each example
6May 9 STL: hash tables, random, use with functors/lambda fns emplace example, lz78 hash table example, random number example
7May 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
8May 23concurrency 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
9May 30perfect 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
10Jun 6constexpr, 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

Resources

More Information

Address

University of California, Riverside
Chung Hall, room 327
Riverside, CA 92521
Tel: (951) 827-2554
E-mail: cshelton@cs.ucr.edu

 


Other Links