Зарегистрироваться
Восстановить пароль
FAQ по входу

Galowicz Jacek. C++ 17 STL Cookbook

  • Файл формата pdf
  • размером 11,26 МБ
  • Добавлен пользователем
  • Описание отредактировано
Galowicz Jacek. C++ 17 STL Cookbook
Packt Publishing, 2017. — 532 p. — ISBN10: 9781787120495; ISBN13: 978-1787120495.
The New C++17 Features
Using structured bindings to\xc3\x82\xc2\xa0unpack bundled return values'.
Limiting variable scopes to if and switch statements'.
Profiting from the new bracket initializer rules'.
Letting the constructor automatically deduce the resulting template class type'.
Simplifying compile time decisions with constexpr-if'.
Enabling header-only libraries with inline variables'.
Implementing handy helper functions with fold expressions'.
STL Containers
Introduction'.
Using the erase-remove idiom on std::vector'.
Deleting items from an unsorted std::vector in O(1) time'.
Accessing std::vector instances the fast or the safe way'.
Keeping std::vector instances sorted'.
Inserting items efficiently and conditionally into std::map'.
Knowing the new insertion hint semantics of std::map:: insert'.
Efficiently modifying the keys of std::map items'.
Using std::unordered_map with custom types'.
Filtering duplicates from user input and printing them in alphabetical order with std::set'.
Implementing a simple RPN calculator with std::stack'.
Implementing a word frequency counter with std::map'.
Implement a writing style helper tool for finding very long.
sentences in text with std::multimap'.
Implementing a personal to-do list using std::priority_queue'.
Iterators
Introduction'.
Building your iterable range'.
Making your iterators compatible with STL iterator categories'.
Using iterator adapters\xc3\x82\xc2\xa0to fill generic data structures'.
Implementing algorithms in terms of iterators'.
Iterating the other way around using reverse iterator adapters'.
Terminating iterations over ranges with iterator\xc3\x82\xc2\xa0sentinels'.
Automatically checking iterator code with checked iterators'.
Building your ZIP iterator adapter'.
Lambda Expressions
Introduction'.
Defining functions on the run using lambda expressions'.
Adding polymorphy by wrapping lambdas into std::function'.
Composing functions by concatenation'.
Creating complex predicates with logical conjunction'.
Calling multiple functions with the same input'.
Implementing transform_if using std:: accumulate and lambdas'.
Generating cartesian product pairs of any input at compile time'.
STL Algorithm Basics
Introduction'.
Copying items from containers to other containers'.
Sorting containers'.
Removing specific items from containers'.
Transforming the contents of containers'.
Finding items in ordered and unordered vectors'.
Limiting\xc3\x82\xc2\xa0the values\xc3\x82\xc2\xa0of a vector to a specific numeric range with std::clamp.
Locating patterns in strings with std::search and choosing the optimal implementation.
Sampling large vectors.
Generating permutations of input sequences'.
Implementing a dictionary merging tool'.
Advanced Use of STL Algorithms
Introduction'.
Implementing a trie class using STL algorithms'.
Implementing\xc3\x82\xc2\xa0a search.
input\xc3\x82\xc2\xa0suggestion generator with tries'.
Implementing the Fourier transform formula with STL numeric algorithms'.
Calculating the error sum of two vectors'.
Implementing an ASCII Mandelbrot renderer'.
Building our own algorithm - split'.
Composing useful algorithms from standard algorithms - gather'.
Removing consecutive whitespace between words'.
Compressing and decompressing strings'.
Strings, Stream Classes, and Regular Expressions
Introduction'.
Creating, concatenating, and transforming strings'.
Trimming whitespace from the beginning and end of strings'.
Getting the comfort of std::string\xc3\x82\xc2\xa0without the cost of constructing std::string objects'.
Reading values\xc3\x82\xc2\xa0from user input'.
Counting all words in a file'.
Formatting your output with I/O stream manipulators'.
Initializing complex objects from file input'.
Filling containers from std::istream iterators'.
Generic printing with std::ostream iterators'.
Redirecting output to files for specific code sections'.
Creating custom string classes by inheriting from std::char_traits'.
Tokenizing input with the regular expression library'.
Comfortably pretty printing numbers differently per context on.
the fly'.
Catching readable exceptions from std::iostream errors'.
Utility Classes
Introduction'.
Converting between different time units using std::ratio'.
Converting between absolute and relative times with\xc3\x82\xc2\xa0std::chrono'.
Safely signalizing failure with std::optional'.
Applying functions on tuples'.
Quickly composing data structures with std::tuple'.
Replacing void* with std:: any for more type safety'.
Storing different types with std::variant'.
Automatically handling resources with std::unique_ptr'.
Automatically handling shared heap memory with std::shared_ptr'.
Dealing with\xc3\x82\xc2\xa0weak pointers to\xc3\x82\xc2\xa0shared objects'.
Simplifying resource handling of legacy APIs with smart pointers'.
Sharing different member values\xc3\x82\xc2\xa0of the same object'.
Generating random numbers and choosing the right random number engine'.
Generating\xc3\x82\xc2\xa0random numbers and letting the STL shape specific distributions'.
Parallelism and Concurrency
Introduction'.
Automatically parallelizing code that uses standard algorithms'.
Putting a program to sleep for specific amounts of time'.
Starting and stopping threads'.
Performing exception safe shared locking with std::unique_lock and std::shared_lock'.
Avoiding deadlocks with std::scoped_lock'.
Synchronizing concurrent std::cout use'.
Safely postponing initialization with std::call_once'.
Pushing the execution of tasks into the background using std:: async'.
Implementing the producer/consumer idiom with std::condition_variable'.
Implementing the multiple producers/consumers idiom with.
std::condition_variable'.
Parallelizing the ASCII Mandelbrot renderer using std:: async'.
Implementing a tiny automatic parallelization library with std::future'.
Filesystem
Introduction'.
Implementing a path normalizer'.
Getting canonical\xc3\x82\xc2\xa0file paths from relative paths'.
Listing all files in directories'.
Implementing a grep-like text search tool'.
Implementing an automatic file renamer'.
Implementing a disk usage counter'.
Calculating statistics about file types'.
Implementing a tool that reduces folder size by substituting duplicates with symlinks.
  • Чтобы скачать этот файл зарегистрируйтесь и/или войдите на сайт используя форму сверху.
  • Регистрация