Weinman Bill - C++23 STL Cookbook. Master The Latest STL Features In C++23 And 26 (2nd Edition) [2026, EPUB, ENG]

Страницы:  1
Ответить
 

Kinesta

Стаж: 12 лет 4 месяца

Сообщений: 74

Kinesta · 19-Июл-26 19:43 (1 день 4 часа назад, ред. 19-Июл-26 19:49)

C++23 STL Cookbook. Master The Latest STL Features In C++23 And 26 (2nd Edition)
Год издания: 2026
Автор: Bill Weinman
Жанр или тематика: Программирование
Издательство: Packt
ISBN: 978-1-83620-425-1
Язык: Английский
Формат: EPUB
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 496
Описание:
Key benefits
  1. Elevate your code with the latest C++23 strategies and techniques to solve complex programming challenges effectively
  2. Learn about new features of C++26, and how to implement them.
  3. Explore the proposed standardized library and how it integrates with existing C++ applications
  4. Dive into the latest C++23 innovations such as enhanced ranges and advanced concurrency features with new and updated recipes
Description
C++ STL Cookbook is a comprehensive guide that provides practical solutions for mastering the latest features of the C++23 Standard Template Library (STL) through hands-on recipes. Beginning with new features in C++23, this book will help you understand the language's updated mechanics and library features, and offer insights into how they work. Unlike other books, this cookbook takes an implementation-specific, problem-solution approach that will help you overcome hurdles quickly. You'll learn core STL concepts, such as containers, algorithms, utility classes, lambda expressions, iterators, and more, through specific real-world recipes. Building on the success of the first edition, this updated guide includes a new chapter dedicated to the latest features introduced in C++23, such as improved modules, refined ranges, and coroutine-based generators. It also covers essential best practices for writing cleaner and more efficient code, including the use of coroutines, structured bindings, and std::span. Whether you're looking to deepen your understanding of the C++ STL or implement the latest features in your projects, this book provides valuable insights, clear and concise explanations and practical solutions to enhance your C++ programming skills.
Who is this book for?
This book is for intermediate to advanced C++ programmers who want to get the most out of the Standard Template Library in C++23 and C++26, the latest versions of C++. Basic knowledge of coding and C++ concepts is necessary to get started with this book.
What you will learn
  1. Write cleaner and more efficient code using modern C++ techniques
  2. Implement and master the latest features introduced in C++23
  3. Use the new standard library modules in C++23
  4. Learn about new features of C++26, and how to implement them
  5. Expand your use of ranges with new components and functionalities
  6. Implement coroutines for more efficient concurrency
  7. Employ braced initialization for safer and clearer object creation
  8. Leverage std::span for enhanced safety with C-arrays
Оглавление

Preface
About this book
Prerequisite knowledge
The STL's power is derived from templates (a brief primer)
This book uses the C++23 standard
Hiding the std:: namespace
Type aliases with using
Abbreviated function templates
Use the STL to solve real-world problems
The recipes in this book use the GCC compiler
Free benefits with your book
Chapter 1: Introduction to New C++23 Features
Simplify your code with the std module
Format text with the new print() and println() functions
Use synchronous generators
Use mdspan as a multidimensional array
Initialize containers from ranges
Find content in strings and ranges with contains()
Subscribe to Deep Engineering
Chapter 2: Best Practices
Use braced initialization
Use span to make C-arrays safer
Use structured binding to return multiple values
Initialize variables within if and switch conditionals
Use template argument deduction for simplicity and clarity
Use RAII to preserve memory integrity
Chapter 3: STL Containers
A quick overview of the STL container types
Sequential containers
Associative containers
Container adapters
Use uniform erase functions to delete elements from a container
Delete items from an unsorted vector
Access vector elements safely
Keep vector elements sorted
Efficiently insert elements into a map
Efficiently modify keys in a map
Use unordered_map with custom keys
Sort and filter user input with set
Create a simple RPN calculator with deque
Count word frequency with map
Find long sentences with a vector of vectors
Create an efficient ToDo list using multimap
Subscribe to Deep Engineering
Chapter 4: STL Compatible Iterators
Iterators are fundamental
Iterator categories
Iterator concepts
Create an iterable range
Use traits with your iterators for STL compatibility
Use iterator adaptors to populate STL containers
Iterate backward with a reverse adaptor
Iterate objects of unknown length with a sentinel
Create a generator with iterators
Create a generator with coroutines
Build a zip iterator adaptor
Create a random-access iterator
Operator overloads
Validation code
Chapter 5: Lambda Expressions
Lambda expressions
Closures
Use lambdas for scoped, reusable code
Capture list
Parameters
The mutable modifier (optional)
The constexpr specifier (optional)
The noexcept attribute (optional)
The trailing return type (optional)
Use lambdas as predicates with algorithms
Create a polymorphic wrapper with std::function
Concatenate lambdas with recursion
Combine predicates with logical conjunction
Pass common parameters to multiple lambdas
Create a simple jump table with mapped lambdas
Subscribe to Deep Engineering
Chapter 6: STL Algorithms
Copy from one iterator to another
Join container elements into a string
Sort containers with std::sort
Modify containers with std::transform
Search containers with std::find
The new contains() method
Limit container values with std::clamp
Sample data sets with std::sample
Use ranges for more powerful algorithms
Generate permutations of data sequences
Merge sorted containers
Chapter 7: Strings and Formatting
Use string_view as a lightweight string object
Format text with the format library
Print strings with std::print and std::println
Concatenate strings
Benchmarks
Why the performance discrepancy?
Why would I choose one over another?
Transform strings
Trim whitespace from strings
Read strings from user input
Count words in a file
Initialize complex structures from file input
Customize a string class with char_traits
Parse strings with regular expressions
Subscribe to Deep Engineering
Chapter 8: Utility Classes
Manage optional values with std::optional
Use std::any for type safety
Store different types with std::variant
Differences from the union primitive
Time events with std::chrono
The clock classes
std::duration class
Use fold expressions for generic tuples
Fold expressions
Manage allocated memory with std::unique_ptr
Share objects with std::shared_ptr
Use weak pointers with shared objects
Share object members with aliased smart pointers
Compare random number engines
Comparison of random number distribution generators
Chapter 9: Concurrency and Parallelism
Sleep a process for a specific amount of time
There's more…
Use std::thread for concurrency
There's more…
Use std::async for concurrency
Simplify promise and future with std::async()
Run STL algorithms in parallel with execution policies
Use mutex and lock to safely share data
There's more…
Share flags and values with std::atomic
Specializations
Pointers and smart pointers
Floating-point types
Integral types
Standard aliases
Lock-free variations
There's more…
Initialize threads with std::call_once
Resolve the producer-consumer problem with std::condition_variable
Implement multiple producers and consumers
Suspend and resume execution with coroutines
Use coroutines for a producer-consumer solution
Subscribe to Deep Engineering
Chapter 10: Using the File System
Specialize std::formatter for the path class
Use manipulation functions with path
List files in a directory
Search directories and files with a grep utility
Rename files with regex and directory_iterator
Create a disk usage counter
Chapter 11: More Practical Ideas
Create a trie class for search suggestions
Calculate the error sum of two vectors
There's more…
Build your own algorithm: split
There's more…
Leverage existing algorithms: gather
Remove consecutive whitespace
Convert numbers to words
There's more…
Subscribe to Deep Engineering
Chapter 12: C++26 and the Future
Static reflection
Contracts
Structural pattern matching
Other C++26 improvements
Chapter 13: Unlock Your Exclusive Benefits
Unlock this Book's Free Benefits in 3 Easy Steps
Other Books You May Enjoy
Index
Download
Сайт не распространяет и не хранит электронные версии произведений, а лишь предоставляет доступ к создаваемому пользователями каталогу ссылок на торрент-файлы, которые содержат только списки хеш-сумм
Как скачивать? (для скачивания .torrent файлов необходима регистрация)
[Профиль]  [ЛС] 
 
Ответить
Loading...
Error