Lecture overview -- Keyboard shortcut: 'u'  Source programs in previous lecture -- Keyboard shortcut: 'p'    Course home

Source Programs
The Standard Library and Metaprogramming

The Note Context in the rightmost column is only shown in case an annotated program exists. - You can navigate to the annotated program via the annotated slide view (= 'the note context').

A really simple example of iterators.it-1.cppSlide context--
The same program using a reverse iterator.rit-1.cppSlide context--
Equivalent program with range-for - with iterators abstracted away - C++11.it-1-range-for.ccSlide context--
Output insert-iterators and factory functions that create such iterators.ins-2.cppSlide context--
Same program - simplified in various ways in C++11.ins-2.cppSlide context--
Illustration of priority_queue<Point, deque<Point> >.pri-queue-1.cppSlide context--
Class point with an overloaded operator<.point.hSlide context--
The implementation of class Point and in particular operator<.point.ccSlide context--
Illustration of the map standard container.map-2.cppSlide context--
Alternative version - using range-for for traveral of the map.map-3.cppSlide context--
Illustration of the use of member types for a list of chars.mem-types-1.cppSlide context--
Same program - now with use of typename as prefix of 'nested dependent type names'.mem-types-2.cppSlide context--
Illustration of a couple of ambiguities.ambiguities-1.cppSlide context--
Ambiguities resolved.ambiguities-2.cppSlide context--
An alternative resolution of the ambiguity .ambiguities-3.cppSlide context--
Illustration of the use of vector<bool>.vec-bool-3.cppSlide context--
Another slightly more complicated (almost) equivalent program.vec-bool-1a.cppSlide context--
A possible implementation of the for-each algorithm.for-each-reproduction-1.cppSlide context--
Implementation and sample use of for-each on a list of integers.for-each-reproduction-2.cppSlide context--
Use of std::for-each instead of our own definition of for-each.for-each-real-use.cppSlide context--
Class Point with overloadings of the application operator.point.hSlide context--
Definition of funny Point application operators.point.ccSlide context--
Sample uses of the application operators - Funny and artificial.prog.ccSlide context--
Class Point with another overloading of the application operator.point.hSlide context--
Definition of then Point application operator.point.ccSlide context--
Sample uses of the application operators - slightly more realistic.prog.ccSlide context--
Two overloads of the sort function template.sort-signaturesSlide context--
Sorting a vector of integers.prog-2-kn.cppSlide context--
A possible use of for-each to solve this problem.for-each-1.cppSlide context--
Following the advice: Solve the problem with a more appropriate algorithm.adjacent-1.cppSlide context--
Possible definitions of the type greater and its base class.greater-and-binary-function.cppSlide context--
An illustration of plus<double>.plus-1.cppSlide context--
A possible definition of plus.plus-3.cppSlide context--
Another definition of plus - as a function template.plus-4.cppSlide context--
Yet another alternative where a lambda expression is used.plus-5.cppSlide context--
Illustration of member function adaptions.memb-adapt-1.cppSlide context--
The definition of Point - point.h.point.hSlide context--
Static assert about the size of int.p1.ccSlide context--
Static asserts abstracted in constexpr function.p4.ccSlide context--
An example a static_assert in a template user specialization program.prog1.cppSlide context--
Illustration of of type functions in a number static assertions - all of which hold.p5.ccSlide context--
Examples of constant expressions - C++11.constexpr-1.cppSlide context--
The same program - with results statically asserted.constexpr-1-statass.cppSlide context--
Evaluation of constexpr at run-time - C++11.constexpr-4.cppSlide context--
Relaxed constexpr in C++14.constexpr-5.cppSlide context--
Examples of a literal type, struct Point - C++11.constexpr-2.cppSlide context--
The same program - with results statically asserted.constexpr-2-statass.cppSlide context--
Examples of class Circle with a constexpr constructor - C++11.constexpr-3.cppSlide context--
An sample use of conditional.cond-2.ccSlide context--
Same - syntactically embellished.cond-3.ccSlide context--
Use of my_conditional in the example from above.cond-3-realistic.ccSlide context--
Possible definition of conditional - here as my_conditional.conditional-def.ccSlide context--
Use of my_conditional - in the example from above.cond-4.ccSlide context--
Selection one of two functions at compile time.cond-5.ccSlide context--
Class Point header file - where move is only enabled for floating point types.point.hSlide context--
Implementation of Point<C> members.point.ccSlide context--
Use of class Point<double> with move - OK.prog1.ccSlide context--
Use of class Point with move - does not compile.prog2.ccSlide context--
First version of type function.int-types.ccSlide context--
Second version of type function - embellished syntax of the type function.int-types-1.ccSlide context--
The ugly and bulky selection stuff.select-stuff.ccSlide context--
Yet another version of type function - generalized to selection among an arbitrary number of types.int-types-2.ccSlide context--
General selection stuff - shorter and more elegant - using variadic templates (C++11).select-stuff-general.ccSlide context--
The factorial function defined as a constexpr function (C++11).fac-1.ccSlide context--
The factorial function defined as a function template - using a template int parameter.fac-2.ccSlide context--
The factorial function programmed in struct - with recursion.fac-3.ccSlide context--
The factorial function - from Wikipedia.fak1.cppSlide context--
The power function on integer type arguments.pow1.cppSlide context--
The power function on integer type arguments - alternative implementation with an enumeration constant.pow1a.cppSlide context--
A more advanced version of the power function - from Stack Overflow.pow3.cppSlide context--
A variant of the more advanced version of the power function.pow4.cppSlide context--

Generated: Tuesday August 1, 2017, 13:32:23