Advanced C++

Login to KOS for course enrollment Display time-table
Code Completion Credits Range Language
18PCP Z,ZK 4 2+2 Czech
Miroslav Virius
Miroslav Virius
Department of Software Engineering

This lecture covers the virtual inheritance,variadic templetes, template metaprogramming, template libraries design and implementation, tools for data type processing in compile time and for the advanced diagnostic of the templates, application of the multithreading (execution parallelization), treating the locales (localization and internationalization of the software), the tools for advanced mathematical and technical computing and the file system access tools.


Programming in C++ 1, 2.

Syllabus of lectures:

1 Moving instances

2. Virtual inheritance

a. Syntactic rules, importance

b. Instance structure

c. Example

3. Template metaprogramming

a. Computational completeness of the templates

b. Type to type mapping, value to type mapping

c. Branching, loop substitution

d. Application, examples

4. Variadic templates (variable argument number templates) I.

a. Syntactic rules, parameter pack

b. parameter pack expansion

c. Examples

5. Variadic templates II.

a. Template metaprogramming with variadic templates

b. Diagnostics tools

c. Examples

6. Data type processing in compile time

a. static_assert declaration

b. type_traits standard header

c. Template parameter testing

d. Data type transformation in compile

e. Examples

7. Container classes, algorithms

a. Sequence containers

b. Associative containers

c. Container-like classes

d. Container processing algorithms

8. File system access, advanced input/output tools

a. File path processing

b. File manipulation

c. Extended manipulators and output formatting

d. Examples

8. Multithreading I

a. Thread and its states, std::thread class

b. Basic operations with threads

c. Data access sybchronization

d. Examples

9. Multithreading II

a. Memory model

b. Atomic types

c. Asynchronous processing

d. Examples

10. String processing

a. The std::basic_string class

b. The std::basic_string_view class

c. Tools for the regular expressions

d. Regular expressions according the selected specification

e. Examples

11. Localization and internationalization

a. The std::locale class

b. Setting locale

c. Character, date, time processiong, alphabetic ordering

d. Examples

12. Mathematic computing

a. The std::valarray class ant its application for the computing

b. Pseudo random numbers generators ant its application for the computing

c. Additional tools

d. Examples

13. Repetition, examples

Syllabus of tutorials:

1. Introduction - organization matter, tools used, repetition of the necessary knowledge. Virtual inheritance.

2. Template metaprogramming

a. Basic constructs.

b. Optimisation of selectes algorithmsusing template metaprogramming

3. Variadic templates I.

a. Parameter pack expansion examples

4. Variadic templates II.

a. Using template metaprogramming with variadic templates

b. Implementation of selected algorithms using variadic templates

c. Diagnostic in templates

5. Data type processing in compile time

a. Using the static_assert declaration

b. Common type derivation, basic type derivation, data type requirements verification, additionals type template parameter processing

6. Containers, algorithms

a. Sequence processing with STL algorithms

b. Associative container processing with STL algorithms

7. File system access, advanced input/output

a. File manipulation program implementation

8. Multithreading I

a. Thread and its states, the std::thread class

b. Simple multithread programs; race condition example and data access synchronization

9. Multithreading II

a. Atomic types, asynchronous processing examples

10. String processing

a. Formatting

b. Using the std::basic_string_view class

c. Regular expressions

11. Localization a internationalization

a. Filter SORT implementation (alphabetic ordering, locale dependent formatting and other tools)

12. Mathematic computing

a. Implementation of a class representich matrix with simple tools for row, column and other ?slices? maniúpulation

b. Using pseudo random number generation for simple simulations

13. Student program presentation

Study Objective:

The lecture provides a complex view on advanced tools in the C++ programming language and on the best practices for their application in programming. The lecture covers tools that are part of the C++ standard, but are not covered by the basic course. These tools are necessary for the development of advanced C++ libraries aimed not only to the effectivity, but also to the design and architecture quality.

Study materials:

1.Stroustrup, Bjarne: The C++ Programming Language, 4th Edition. Addison-Wesley 2013. ISBN 978-0321563842


Media and tools

?Computer with operating system, monitor, keyboard and mouse

?Integrated development environment (IDE) with C++ compiler supporting the ISO 14882:2011 standard actualized according to C++14 (or newer one)

Time-table for winter semester 2020/2021:
Time-table is not available yet
Time-table for summer semester 2020/2021:
Time-table is not available yet
The course is a part of the following study plans:
Data valid to 2021-03-01
For updated information see http://bilakniha.cvut.cz/en/predmet5251206.html