C ++ course in CS center, second part

Computer Science Center is a joint initiative of the Computer Science Club at POMI RAS, JetBrains and the Yandex Data Analysis School .



The center exists to enable talented students and graduates to develop in areas of interest to them: Computer Science, Data Science or Software Engineering.



The C ++ course in two parts at the center is taught by Valery Mikhailovich Lesin, valery-l , lecturer at the CS center and joint magistracy ITMO and JetBrains "Software Development / Software Engineering", technical director of Simlabs .



The second part will help to master most of the capabilities of modern C ++. Most likely, you will not become a guru at the end of the second semester, but the skill should be enough to effectively use C ++ in most projects, if the advantages are applicable there.



We will explore the new features of the language and the standard library: move semantics, bind / function, enable_if / if constexpr, coroutines, and others. Let's look at some typical tasks: multi-threaded programming, using libraries in Windows and Linux, and others.



Enjoy watching!



1. Standard library. Composition, STL containers, container types, vector container, iterators, how the vector works. Sdt :: list container, adapters, associative containers, map iteration, search and insert into map. Indexing, removing from map (set). Other associative containers.





2. Move semantics && perfect forwarding. Fast programs. Return Value Optimization. Lvalue vs Rvalue. How to distinguish a temporary object from a non-temporary one. Converting & <-> const & <-> &&. Move constructor vs other constructors. Return the vs && value from the function. Return large objects by value, transfer by value. Forwarding argument problem. New rules for links in C ++ 11. Perfect forwarding.





3. Algorithms and functors. Standard algorithms, description of algorithms. Non-modifying and modifying operations. Sort and search. Containers vs iterators. Standard functors. Boost range. Range concept.





4. bind & function. Task: calling a callback. A bit of magic - std :: bind. How to avoid copying. ref / cref. Using bind with functors. Call methods. Nesting bind. std :: function. Synergistic effect of bind & function. Performance. How placeholders work.





5. Exceptions. Ways to handle errors. try ... catch. Types of Exceptions Using RAII. Passing parameters. Class stack. Security guarantees for exceptions. Guaranteed no exceptions. Copy stack. Reduced stack requirements. Specification of exceptions. noexcept operator and noexcept specification (C ++ 11). STL containers. Warranties and requirements stack.





6. To SFINAE or not to SFINAE. Code selection based on type. Type selection by condition. Reducibility test. Check for the base class. SFINAE. Check for container. Selection by type property.





7. C ++ innovations. Anonymous functions, auto, decltype, variadic templates, parameter pack, pack expansion & fold expression. Non-static data member initializers, if constexpr.





8. Rows. Input Output. Encoding (character set). String std :: basic_string. Basic string operations. boost string algorithms. Text vs Binary files format. I / O streams, output, input, stream status, formatted input / output. Manipulators, file streams.





9. The preprocessor. The use and applicability of macros. Definition of constants, conditional compilation. Include guard. Macro function. Turning a token into a string, concatenating tokens. Multiline macro, predefined defines. assert. Variable macro, macro overload. Pimpl idiom.





10. Libraries. Static and dynamic libraries. Static vs Dynamic. Downloading libraries without prior linking. Exported functions. COM technology.





11. Multithreading. Process and threads. Types of multitasking. Problem situations. Create stream. The stream object is std :: thread. Secondary functions. Mutual exclusion. Lock management. Exception catching. Exception rethrow. Condition variables.





12. Multithreading. Part 2. Deferred calculations. Future and Promise. Async and Future. Queue of events / messages. Contracts, concepts.





First part of the course



All Articles